-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Mark some System.Collection APIs as unsupported on Browser WASM #41085
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
Mark some System.Collection APIs as unsupported on Browser WASM #41085
Conversation
|
Tagging subscribers to this area: @safern, @ViktorHofer |
| Initialize(); | ||
| } | ||
|
|
||
| [UnsupportedOSPlatform("browser")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This throws everywhere. Why mark it as unsupported for browser only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good question, thanks. I'm not sure if there is something like [UnsupportedOSPlatform("all")] to mark it for all the possible platforms. So in this case I've done it only for the related part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @jeffhandley @adamsitnik did we consider an "all" value for the analyzer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would [Obsolete] be more appropriate for something not supported anywhere?
This makes me feel uneasy saying it, but I think you could pull off "not supported anywhere" by using [SupportedOSPlatform("none")]; I don't think I would endorse it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would start with some better examples than this one.
The binary serialization methods touched in this PR are on interfaces and/or not meant to be directly called by user code. It means that the annotations on them are not going to make any difference in user experience. I think that the right action for these specific methods may be to do nothing and leave them alone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree these ones we should not annotate them at all. I was just wondering if we should support an annotation for "ALL" platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just wondering if we should support an annotation for "ALL" platforms.
I'll follow up on that off this issue
|
I am not sure whether it makes sense to start marking the binary serialization support methods as unsupported. @GrabYourPitchforks Do you have thoughts on this? The binary serialization support methods are not meant to be directly called by user code, so marking them as unsupported via attributes does not provide much value. |
Thanks for clarification. There are over 4500 members that throw PNSE on Browser WASM at the moment. I picked up some small portion consisting of only System.Collection-related items for this PR. If those are not supposed to be marked then I could proceed with other namespaces. |
|
Based on the feedback, I'm closing this PR for now. |
|
@jkotas I agree it doesn't add much value to annotate serialization-related infrastructure. If the annotations are added by hand I'd not burn cycles adding them. |
The following methods from System.Collections.* namespaces were listed by the platform compatibility analyzer (https://github.com/dotnet/platform-compat) as throwing PNSE on Browser WASM so they can be marked as unsupported using
UnsupportedOSPlatformAttribute("browser")attribute:Part of #41087