Skip to content

Make DependencyInjection more linker trimmable - #38729

Merged
eerhardt merged 3 commits into
dotnet:masterfrom
eerhardt:DependencyInjectionTrimmable
Jul 3, 2020
Merged

Make DependencyInjection more linker trimmable#38729
eerhardt merged 3 commits into
dotnet:masterfrom
eerhardt:DependencyInjectionTrimmable

Conversation

@eerhardt

Copy link
Copy Markdown
Member

Allow the unused ServiceProviderEngine strategy types to be trimmed by the ILLinker by removing the ServiceProviderMode enum and only have the "default" behavior in the product. The ServiceProviderMode enum is only used for testing, so move it to the tests.

Fix#38678

This allows for System.Linq.Expressions to be completely removed in a default Blazor application. It also removes one of two usages of System.Reflection.Emit (the other being #38693).

With this change, the IL size of a Blazor WASM default template application:

BuildSize
master3,366,912 bytes
PR3,039,232 bytes

Allow the unused ServiceProviderEngine strategy types to be trimmed by the ILLinker.
Fixdotnet#38678
@Dotnet-GitSync-Bot

Copy link
Copy Markdown
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@eerhardt
eerhardtforce-pushed the DependencyInjectionTrimmable branch from 631a92e to faaee83CompareJuly 3, 2020 12:45
@eerhardt
eerhardt merged commit 2014fb5 into dotnet:masterJul 3, 2020
@eerhardt
eerhardt deleted the DependencyInjectionTrimmable branch July 3, 2020 15:28
@ghostghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make DependencyInjection more linker trimmable

4 participants

@eerhardt@Dotnet-GitSync-Bot@pakrym@maryamariyan