-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Update default TrimMode for WebSDK projects #33962
Conversation
401ba29
to
58f8858
Compare
58f8858
to
5808477
Compare
@captainsafia might be worth getting @agocke to check this too. Also, just to confirm, this should have on impact on Blazor WebAssembly projects right? They have to still use |
Sure.
Yes, Blazor is unaffected. The fact that these tests pass helps us confirm this. |
Blazor WASM sets it early in the project (in the .props file) here: sdk/src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.props Lines 20 to 23 in 6446f88
|
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.
LGTM, thanks!
Blazor may be worth a test somewhere -- I assume there's one in their repo.
Yes, here. |
|
||
<!-- If TrimMode has not already been set, default to partial trimming, as AspNet is not currently fully trim-compatible --> | ||
<!-- We allow the full trimming default with PublishAot enabled, because the parts that are not trim-compatible are not aot-compatible either --> | ||
<TrimMode Condition="'$(TrimMode)' == '' and '$(PublishTrimmed)' == 'true' and '$(PublishAot)' != 'true'">partial</TrimMode> |
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.
Uggh, I just realized that we probably should be leaving TrimMode=partial
for TFMs below net8.0
. I don't think we should be changing behavior for people when they upgrade their SDK. Only when they retarget from net6/7.0
=> net8.0
.
Set
TrimMode=full
for web projects wherePublishTrimmed=true
.Note: we could achieve the same effect by removing the property all together and relying on the defaults the linker targets set but I like the explicitness of this approach.