Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In .NET 9, remove dependency on Microsoft.Extensions.Primitives by using Span<char> instead of StringSegment #84

Open
WalkerCodeRanger opened this issue Sep 28, 2024 · 0 comments
Assignees
Milestone

Comments

@WalkerCodeRanger
Copy link
Owner

The version parsing uses Microsoft.Extensions.Primitives.StringSegment to efficiently pass subsegments of strings without constructing new string instances. That library supports all the versions that the semver library does and provides all the needed functionality. As of .NET 9, Microsoft is adding additional methods to do things like split a Span<char> at separator characters. With that, there should be enough support in the BCL to implement semver in terms of Span<char> instead. That would eliminate the dependency on Microsoft.Extensions.Primitives, thereby reducing installed size in apps using the library and avoiding any conflicting dependency version issues.

I will investigate doing this for the next patch version. However, if it causes too much mess in the code to support a variation for newer versions, I may not do this.

@WalkerCodeRanger WalkerCodeRanger added this to the v3.1.0 milestone Sep 28, 2024
@WalkerCodeRanger WalkerCodeRanger self-assigned this Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant