All Versions
13
Latest Version
Avg Release Cycle
44 days
Latest Release
1335 days ago

Changelog History
Page 2

  • v6.1.0 Changes

    September 12, 2019

    ๐Ÿ”„ Change Log

    ๐Ÿ‘€ v6.1.0 (9/12/2019)

    ๐Ÿ‘€ Full Changelog

    ๐Ÿ”€ Merged Pull Requests

    โž• Added better docs around scoping (8/29/2019) #501 (seesharper)

    โž• Added a buy me a coffee link (8/29/2019) #502 (seesharper)

    ๐Ÿ”‹ Feature/enable current scope (9/1/2019) #504 (seesharper)

    This PR allows the container NOT to maintain the current scope. For instance in AspNet.Core, services are always requested directly from the scope and maintaining a current scopes is just unnecessary overhead.
    ๐ŸŽ Performance improvements for scoped/tracked services (9/12/2019) #505 (seesharper)

    ๐ŸŽ This PR introduces a few performance improvements when requesting services that requires a scope.

    ๐Ÿ‘ Also added support for disabling the "current scope" through ContainerOptions.EnableCurrentScope
    โž• Added support for configure action (9/12/2019) #506 (seesharper)

    ๐Ÿ”ง This PR adds support for configuring the ContainerOptions using a delegate.

    var container = new ServiceContainer(o => o.EnablePropertyInjection = false);
    

    ๐Ÿฑ Requested by @haavamoa ๐Ÿ˜Ž
    ๐Ÿ‘€ Document EnableCurrentScope (9/12/2019) #507 (seesharper)

    ๐Ÿ‘€ Use ContainerOptions.Default (9/12/2019) #508 (seesharper)

    ๐Ÿ‘€ This PR fixes a bug introduced in #506 where we did not respect ContainerOptions.Default

    Thanks to @haavamoa for spotting the error
    ๐Ÿ›  Fixes #476 (9/12/2019) #509 (seesharper)

    ๐Ÿ‘€ This PR fixes #476 by not passing the emitters and making sure that we register all available services.

    Closed Issues
    • ๐Ÿ‘€ Consider passing the current scope to factory methods (8/28/2019) #475 (seesharper)
    • ๐Ÿ‘€ ServiceContainer.Clone() throws System.IndexOutOfRangeException (9/12/2019) #476 (denispakizh)
    • ๐Ÿ‘€ LightInject 6.0 design notes (9/12/2019) #499 (seesharper)
  • v6.0.0 Changes

    August 28, 2019

    ๐Ÿ”„ Change Log

    ๐Ÿ‘€ v6.0.0 (8/28/2019)

    ๐Ÿ‘€ Full Changelog

    ๐Ÿ”€ Merged Pull Requests

    โšก๏ธ Updated an xmldoc typo (7/12/2019) #491 (Hammerstad)

    โšก๏ธ Updated a typo in the xmldoc for ContainerOptions.LogFactory
    โšก๏ธ Update version (8/2/2019) #493 (danielmarbach)

    ๐Ÿ‘€ Given https://github.com/seesharper/LightInject/blob/master/src/LightInject/LightInject.csproj#L5 should the version also be reflected in the source file?
    โž• Added Scope Performance tests (8/11/2019) #498 (seesharper)

    ๐Ÿ‘€ Flow the scope when possible (8/28/2019) #500 (seesharper)

    ๐Ÿ‘ This PR adds support for "flowing" the scope whenever possible.

    This means that we pass the scope that requested a service throughout the object graph.

    Example

    container.RegisterScoped\<IFoo\>(factory =\> new Foo());
    

    The factory passed into the factory delegate is an IServiceFactory and this used to always be the ServiceContainer implementing the IServiceFactory interface. What is changed is that we now pass in the Scope which also implements IServiceFactory.

    When LightInject was born, there was always this notion of a current scope. An ambient context that can be used to access the current scope.
    ๐Ÿ‘ It supports scenarios like

    using (container.BeginScope()) { var foo = container.GetInstance\<IFoo\>(); }
    

    The way this works is that when IFoo is requested we ask for the current scope and use that scope for resolving the instance.

    ๐Ÿ‘ Then we introduced support for getting a service directly from a scope.

    using (var outerScope = container.BeginScope()) { using(var innerScope = container.BeginScope()) { var outerFoo = outerScope.GetInstance\<IFoo\>(); var innerFoo = innerScope.GetInstance\<IFoo\>(); } }
    

    โช The way that this used to work was that we swapped the current scope with the scope from which the service was requested. After we resolved the service we restored the current scope to the previous current scope.

    This was problematic in a number of ways.

    • Swapping the current scope performs really bad as most of the time the current scope is backed by an AsyncLocal<T>.
    • Deferred resolution such as Func<T> and Lazy<T> that always relied on the current scope could end up using the "wrong" scope if someone or something started a new scope using container.BeginScope which in turn sets the current scope to new newly created scope.
    • Multiple parallel scopes was almost impossible to get right because of the assumption that we always have the correct current scope.

    Instead of always relying on the current scope, we pass the scope throughout the code that is generated to resolve an instance. One important aspect of this is that we do this with as little breakage as possible. That means that of the service is directly requested from the scope, we pass that scope without messing with the current scope. If we request a service from the container, the current scope will be used as before.

    ๐ŸŽ It should be noted that requesting service directly from the scope is the preferred way with regards to performance and correctness. We will not remove support for the ambient scope, but we might emit a warning log message in the future.

    Closed Issues
    • ๐Ÿ‘€ Decorator patter with a lifetime that doesn't match the default (5/23/2019) #478 (bounav)
    • ASP.NET Core SetCompatibilityVersion(CompatibilityVersion.Version_2_2) Breaks LightInject (5/23/2019) #482 (nystrup)
    • ๐Ÿ‘€ AspNetCore 2.2 AspNetCoreHostingModel InProcess not working (5/22/2019) #488 (valeriob)
    • ๐Ÿ‘€ Issue w/ Lazy<> and Scoped unit tests. (8/9/2019) #497 (danyhoron)
  • v5.5.0 Changes

    May 16, 2019

    ๐Ÿ”„ Change Log

    ๐Ÿ‘€ v5.5.0 (5/16/2019)

    ๐Ÿ‘€ Full Changelog

    ๐Ÿ”€ Merged Pull Requests

    โœ‚ Remove childscope test (5/15/2019) #486 (seesharper)

    ๐Ÿ‘ป We used to throw an exception when a parent scope was disposed before all child scopes were disposed. This turns out to be a problem in AspNet Core specially when using HttpClientFactory.
    This check has been in LightInject since the beginning, but there is no danger in removing this check as long as all scoped are eventually disposed.
    โฌ†๏ธ Bumped to version 5.5.0 (5/16/2019) #487 (seesharper)

    Closed Issues
    • ๐Ÿ‘€ Custom Dependensies selectors (2/4/2019) #473 (AlexandrSitdikov)
    • ๐Ÿ‘€ Resolve dependencies requiring an implementation created by a parameter factory (3/2/2019) #477 (BrutalSimplicity)
    • ๐Ÿ‘€ ASP.Net Core PerLogicalCallContextScopeManagerProvider Thread Safety (5/2/2019) #483 (AlexFlat)
    • ๐Ÿ‘€ Conditional constructor parameter injection (5/7/2019) #484 (bounav)