ipjohnson / Grace

Grace is a feature rich dependency injection container library
MIT License
336 stars 33 forks source link

Added support for IAsyncDisposable. #285

Closed Lex45x closed 2 years ago

Lex45x commented 2 years ago

According to our discussion in #243, I've made the following changes:

I did not change the version in appveyor.yml. I think we have to build a pre-release first to proceed with changes and integration testing in Grace.DependencyInjection.Extensions. After successful implementation, we can release a stable version for both packages.

Also, with the support of netstandard2.1 features, the codebase looks messy. It would be great to have some decommission plans for netstandard1.0, netstandard2.0, and net45 to push the usage of the latest language features.

I am looking forward to your feedback.

silkfire commented 2 years ago

I did something similar regarding consolidation of framework dependencies here: https://github.com/ipjohnson/Grace.DependencyInjection.Extensions/issues/24

ipjohnson commented 2 years ago

I like what you're doing, you're on the right track. I'm thinking the version number should be 8.0 as you're adding new members to common interfaces..

Lex45x commented 2 years ago

I'm thinking the version number should be 8.0 as you're adding new members to common interfaces..

However, we are not introducing any breaking changes to existing packages. I believe a minor version increase should be enough for that.

ipjohnson commented 2 years ago

We're adding IAsyncDisposable to IDisposalScope which would be a breaking change for anything implementing IDisposalScope.

Lex45x commented 2 years ago

We're adding IAsyncDisposable to IDisposalScope which would be a breaking change for anything implementing IDisposalScope.

That's a great point! I think I saw some parts of Grace that allows usage of custom disposal scopes. Fair enough. I will update appveyor configuration for version 8.0 and let you know.

What else do we need to do to merge this PR?

ipjohnson commented 2 years ago

This has been a busy week so I haven't gotten to pull the source and look at it in the editor. I'll do that this weekend and it if everything looks good I'll merge and release an alpha.

Lex45x commented 2 years ago

I've increased the version in the pipelines. I will start with the changes in Grace.DependencyInjection.Extensions.

Also, I can confirm that in net5.0, IServiceScope will be disposed asynchronously if it implements IAsyncDisposable. https://github.com/dotnet/aspnetcore/blob/v5.0.12/src/Http/Http/src/Features/RequestServicesFeature.cs

ipjohnson commented 2 years ago

I've released 8.0.0 beta

Lex45x commented 2 years ago

@ipjohnson thanks a lot! Opened subsequent PR on Grade.DependencyInjection.Extensions https://github.com/ipjohnson/Grace.DependencyInjection.Extensions/pull/29