anthonyreilly / NetCoreForce

Salesforce REST API toolkit for .NET Standard and .NET Core
MIT License
111 stars 63 forks source link

Modernize IAsyncEnumerable use #21

Closed ronnieoverby closed 3 years ago

ronnieoverby commented 4 years ago

First, I love your library. Great work!

The dependency on the older version of System.Interactive.Async is quite problematic. It causes type name collisions now that those types are present in the core framework.

It would be fantastic to upgrade the dependency to 4.x: https://github.com/dotnet/reactive#v40-changes. Getting rid of that dependency altogether is an option, too, though I think you'd have to drop NETSTANDARD 1.x support.

There are breaking changes involved, though. I took a crack at this, but I started stumbling to fix broken tests in the Linq project.

Thoughts?

ronnieoverby commented 4 years ago

Here's my branch. https://github.com/ronnieoverby/NetCoreForce/tree/upgradeix

It builds, but has some failing tests.

ronnieoverby commented 4 years ago

Another approach: https://github.com/ronnieoverby/NetCoreForce/tree/bcl-async-enumerable

This approach retains the use of the older rx async enumerable package internally, but for netstandard20, it replaces the returned enumerable/enumerator with the bcl types.

It's kind of a lazy approach as the point of it is to avoid refactoring the linq project to cope with the BCL types, but it does do the job of returning the expected types to modern consumers of the library.

anthonyreilly commented 4 years ago

Thanks for looking into this. It might be worth just doing a major version of the library to upgrade the library cleanly, and get it updated for the latest netcore/netstandard anyways. I'm updating my own projects that use this library anyways so I'll need to do it regardless.

ronnieoverby commented 4 years ago

You're welcome and agreed. I was just looking for a quick solution that I could use. I think I'll publish my changes to nuget as an unlisted package since you're going to undertake the library upgrade.

anthonyreilly commented 3 years ago

v3.0.0-Beta is available now: https://www.nuget.org/packages/NetCoreForce.Client/3.0.0-Beta

updated to latest .net targets, compatible with netcoreapp2.1 and 3.1, using the 5.0.0 version of System.Interactive.Async