-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Adding Microsoft.CodeAnalysis.BannedApiAnalyzers for SignalR MessagePackHubProtocol #18291
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
Adding Microsoft.CodeAnalysis.BannedApiAnalyzers for SignalR MessagePackHubProtocol #18291
Conversation
It's hard to sift out the banned changes from all the other changes. If you changed your PR to target your source branch for the other PR, then the diff github would show would just include the banned API changes. From what I can tell, these changes are along the lines of what I had in mind. In terms of syntax for the .txt file, I wouldn't write any of these by hand. It's the syntax used in an xml doc comment file when it references a member, so I would always copy and paste from there, but that's really tedious. Given your interest in getting this done, I'll spend some time today on an analyzer in the messagepack repository that you may be able to just activate to accomplish the same goal. This way you won't have to maintain the list of overloads to ban. |
That would be possible only if the branch was in For now, as you said the way to diff it is to navigate through commit |
Don't mind me here, this PR can be closed and the issue kept open waiting to be discussed by |
…tem.Threading.Tasks.Extensions from 4.5.2 to 4.5.3)
…r (MessagePack v2.0)
…ckReader itself, expection done for reader.ReadBytes()
…ing MessagePackReader that is already consuming the same "ReadOnlyMemory<byte> data
…te, as this is the equivalent in 2.0 see this thread :https://github.com/dotnet/aspnetcore/pull/18133/files?file-filters%5B%5D=.cs&hide-deleted-files=true#r363410254
…w the length of the payload before writing it
…iter instead of the "output" directly
…ly been written to the MemoryBufferWriter
…al one since MessagePack v2.0 when serializing, see details : #18133 (comment) https://github.com/neuecc/MessagePack-CSharp/blob/630ac95b015c7eecffc4399a4498c83aeed99c0b/doc/migration.md#datetime
…MessagePack.csproj
… when not passing parameter MessagePackSerializerOptions
…I when not passing parameter MessagePackSerializerOptions
…hen not passing parameter MessagePackSerializerOptions
@AArnott |
Yes |
TLDR
This PR were closed because the feature is already available out of the box from
MessagePack
itselfit was done here : #19989
Summary of the changes (Less than 80 chars)
Microsoft.CodeAnalysis.BannedApiAnalyzer
MessagePackSerializer
is properly called withMessagePackSerializerOptions
Addresses #18290
(Sorry to ping you here @BrennanConroy , but as you took part in the Review of #18133 I'd love your feedback here too)
Warning
This PR now contains the history of #18133, in order to already build against
MessagePack 2.0.x
.the very first commit of this PR is :
Adding a new dependency to the solution for Microsoft.AspNetCore.SigalR.Protocols.MessagePack.csproj (URL can change/be broken on rebase)
Main doubts here :
Banned Methods
(aka: is this what you had in mid @AArnott) ?MessagePackSerializer.Serialize()
andMessagePackSerializer.Deserialize()
?MessagePackSerializerOptions
is defined as optional (defaulted tonull
) ?CancellationToken
too ? (for now that's what i did)BannedTypes.txt
supports empty lines in the middle ? (yeah dummy questions ^^)MessagePackSerializer.Typeless
too ?ref
parameters, so far i've kept it :public static void Serialize(Type type, ref MessagePackWriter writer, object obj, MessagePackSerializerOptions options = null);
M:MessagePackSerializer.Serialize``1(ref MessagePack.MessagePackWriter,``0)
<T>
and<byte>
like :public static void Serialize<T>(IBufferWriter<byte> writer, T value, MessagePackSerializerOptions options = null, CancellationToken cancellationToken = default);
M:MessagePackSerializer.Serialize``1(System.Buffers.IBufferWriter<byte>,``0);
should it be :
M:MessagePackSerializer.Serialize``1(System.Buffers.IBufferWriter``byte,``0);
?