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

Is it possible to make this library trimmable by default #1436

Open
albertwoo opened this issue May 2, 2022 · 3 comments
Open

Is it possible to make this library trimmable by default #1436

albertwoo opened this issue May 2, 2022 · 3 comments

Comments

@albertwoo
Copy link

Description

I am using this library in blazor wasm application, but this library's bundle size is 1008kb which is a lot for a web application.
I also created similar ticket for FSharp.Data.Adaptive, which they already made it hanppen. fsprojects/FSharp.Data.Adaptive#104
And the result is pretty good.

Known workarounds

People can add below stuff to their own application to make it work. But it is better to have it support by default.

<Target Name="ConfigureTrimming" BeforeTargets="PrepareForILLink">
<ItemGroup>
	<ManagedAssemblyToLink Condition="'%(Filename)' == 'FSharp.Data'">
		<TrimMode>link</TrimMode>
		<IsTrimmable>true</IsTrimmable>
	</ManagedAssemblyToLink>
</ItemGroup>
</Target>
@cartermp
Copy link
Collaborator

cartermp commented May 2, 2022

This library does make a bit of use of reflection. I'm not sure what that means for trimmability.

@albertwoo
Copy link
Author

Then below stuff should be able to add to the project file, so other people do not need to use the workaround.

<TrimMode>link</TrimMode>
<IsTrimmable>true</IsTrimmable>

@albertwoo
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants