-
Notifications
You must be signed in to change notification settings - Fork 230
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
Use Unicode functions consistently and remove helper extension methods that were made public #119
Conversation
I'd really love to hear @mikeobrien's thoughts on this before merging, just to make sure we're clear on which path we want to take moving forward. It would be interesting to find out whether anyone has tried to use those extensions outside the library, but I doubt we will know until someone gets mad 😂 . |
I have no problem with these changes. Seems quite a bit cleaner. |
It's a very easy change to obsolete and hide those extension methods. I made a more radical change initially that we'd only keep if you're both super comfortable with the disclaimers, but I'm really expecting to push a revision that brings them back as obsolete. |
…posed in previous releases
I modified the original commits to no longer delete things in Extensions.cs, and then I added three new commits.
|
Good news! The Roslyn team fixed this very fast and Visual Studio 16.8 will respect That answers the last outstanding question, I think? |
@amullins83 @jnm2 hey, sorry for the late reply. IMO depending on extension methods in a 3rd party library always comes with the risk that they can be changed, esp if they aren't documented as part of the official API. So I don't see any problem with pulling them. Plus this project doesn't even have official API doc's so we have even more latitude.... ;) I guess we should bump the major version since we are following semver and this may be a breaking change for some. |
Major/minor version is set here: https://github.com/mikeobrien/HidLibrary/blob/master/azure-pipelines.yml#L5 |
@mikeobrien I ended up leaving them in; would pulling them be your preference? I'm thinking the major version update could be saved for something more exciting then. |
Ah ok cool, however you have it is fine then. Honestly I'm pretty disconnected from this project so don't have much of a preference on anything. ;) Thx for the PR! |
Cool! @amullins83 @mikeobrien Think it's ready to merge? |
Fixes #72
This one is not urgent. I have improvements I'd like to do in other PRs.
Please review carefully in case I made a mistake. The test suite does execute the affected code paths, and I checked that HidDevice.Description remained the same.
I also removed the public Extensions class with ToUTF8String and ToUTF16String because I don't think it was meant to be public. It has the unfortunate side effect of appearing as an extension method on byte arrays in intellisense for all projects that use HidLibrary. It was added in aad5c64. If any consuming projects did directly call these extension methods, they will fail to recompile against the new version of HidLibrary. If a consuming assembly is not recompiled but runs using the new version of HidLibrary anyway, the .NET runtime will throw MissingMethodException if the consuming project did directly call these extension methods.
An alternative is to obsolete them and put
[EditorBrowsable(EditorBrowsableState.Never)]
on them so that they stop polluting intellisense for all byte arrays in consuming projects.