Skip to content
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

[Breaking change]: TrimMode defaults to full for WebSDK projects #507

Open
1 of 3 tasks
captainsafia opened this issue Jul 14, 2023 · 0 comments
Open
1 of 3 tasks
Labels
8.0.0 Breaking change Documented The breaking change has been published to the .NET Core docs

Comments

@captainsafia
Copy link

Description

Trimming now trims all assemblies in applications targeting the Web SDK, by default. This change only affects apps that are published with PublishTrimmed=true, and it only breaks apps that had existing trim warnings.

Version

.NET 8 Preview 7

Previous behavior

Previously, TrimMode=partial was set by default for all projects that targeted the WebSDK.

New behavior

Starting in .NET 8 Preview 7, trimming trims all the assemblies in the app by default. Apps that may have previously worked with PublishTrimmed=true and TrimMode=partial may not work in .NET 8 Preview 7. However, only apps with trim warnings will be affected. If your app has no trim warnings, the change in behavior should not cause any adverse effect.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
  • Behavioral change: Existing binaries may behave differently at run time.

Reason for change

This change helps to decrease app size without users having to explicitly opt in and aligns with user expectations that the entire app is trimmed unless noted otherwise.

Recommended action

The best resolution is to resolve all the trim warnings in your application. For information about resolving the warnings in your own libraries, see Introduction to trim warnings.

To revert to the previous behavior, set the TrimMode property to partial.

<TrimMode>partial</TrimMode>

Affected APIs

None.

@ghost ghost locked as resolved and limited conversation to collaborators Jul 14, 2023
@gewarren gewarren added the Documented The breaking change has been published to the .NET Core docs label Aug 2, 2023
@guardrex guardrex added the 8.0.0 label Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
8.0.0 Breaking change Documented The breaking change has been published to the .NET Core docs
Projects
None yet
Development

No branches or pull requests

3 participants