-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[wasm] trim System.Private.Uri.dll #74826
Conversation
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsIn the legacy interop, we have edge case use-case: when somebody would This changes the code so that ILLink would not protect Uri class and it could be trimmed out. I think that if the user code calls methods with Uri parameter, they probably also have the Uri constructor in scope.
|
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Given that it is a corner case, I think it is fine. For NET8 it will make sense to add a new feature switch for the legacy JS interop as discussed on discord and hide the reflection behind it.
...opServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/LegacyExports.cs
Outdated
Show resolved
Hide resolved
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
This is how it looks like when the constructor was trimmed. |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
In the legacy interop, we have edge case use-case: when somebody would
bind_static_method("Foo")
wherevoid Foo(Uri uri)
the old marshaler would marshal string asUri
instance in Net6.This feature costs about 103KB of
System.Private.Uri.dll
uncompressed for all runtime/wasm users, regardles if they use it or not.This changes the code so that ILLink would not protect Uri class and it could be trimmed out.
I think that if the user code calls methods with
Uri
parameter, they probably also have theUri
constructor in scope.Even if they don't have it, they could configure ILLink to protect
Uri
after they enabled trimming.My.csproj
ILLink.Descriptors.xml