doghappy / socket.io-client-csharp

socket.io-client implemention for .NET
MIT License
733 stars 126 forks source link

Tweak dependencies #369

Closed thompson-tomo closed 5 months ago

thompson-tomo commented 6 months ago

Restrict TFM's which System.Collection is added for to reduce dependency graph

Closes #368

doghappy commented 6 months ago

Thanks for you PR, but I don't know why need to change, could you please leave extra infos to explain it?

thompson-tomo commented 6 months ago

when a library is compiled for a particular framework ie Net 6 a number of dependencies are provided by the framework hence the developer/publisher is not needing to include them in their release for those frameworks. In this case System.Collections is bundled in to the Framework starting with Net core 5 i think hence when compiling for a newer framework ie Net 6 that explicit dependency is not needed. This is why i have placed a condition so that the package is only included when it is actually needed due to the framework not providing it.

doghappy commented 5 months ago

Hi @thompson-tomo thanks for your advice, may I ask how to check if a package included in target framework or not

thompson-tomo commented 5 months ago

hi @doghappy the easiest way i have found is adding the additional Target frameworks to the project, then expanding the dependencies in the project tree and checking what is included.

image

As you can see in the picture above System.Collections is included in net 6

doghappy commented 5 months ago

I think we can remove both dependencies:

  1. System.Collections
  2. System.Net.Http
doghappy commented 5 months ago

reverted lot of code. and removed those 2 dependencies.

thompson-tomo commented 5 months ago

Handled via https://github.com/doghappy/socket.io-client-csharp/commit/cc4c7f1c25de142c8c1aae5d35ebeeb3cf1ff8c0