fsprojects / FSharp.Control.Reactive

Extensions and wrappers for using Reactive Extensions (Rx) with F#.
http://fsprojects.github.io/FSharp.Control.Reactive
Other
284 stars 58 forks source link

Make this library trimmable #164

Closed albertwoo closed 2 years ago

albertwoo commented 2 years ago

Description

I am using this library in blazor wasm application, but this library's bundle size is 357kb. Which is a lot for a web application. I also created similar ticket for FSharp.Data.Adaptive, which they already made it hanppen. https://github.com/fsprojects/FSharp.Data.Adaptive/issues/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.Control.Reactive'">
        <TrimMode>link</TrimMode>
        <IsTrimmable>true</IsTrimmable>
    </ManagedAssemblyToLink>
</ItemGroup>
</Target>
deviousasti commented 2 years ago

This is a good idea. Does System.Reactive support trimming as well?

deviousasti commented 2 years ago

I don't think we explicitly need to specify TrimMode since link is the default.