You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically reflection usage quite limited and iirc only used ror generating these equality-comparers, so it should be fairly easy to get that running, for some datastructures there's a specialized cheap equals method afair which is then used by the reflection code. If you want to look for these things yourself ShallowEquality is the thing to look for. When I have a little time I can investigate this myself but it might take a few days
Cheers
I quickly took a look and it basically boils down to one helper function that is only called via reflection, all the other things should be fine as long as the trimming process doesn't remove fields from types, sadly I also can't offer any guarantees that this will work. Maybe publishing the test-project trimmed could be sufficient to show that nothing crucial gets removed...
After some local tests I think this works. I'm getting properly trimmed binaries and everything I tested still works as intended.
I'll just get a new version out now so you can test your project with it and I expect nothing to break in absence of trimming.
The new version is 1.2.13 and should be on nuget any minute.
Please let me know if your tests are successful.
Cheers
Activity
krauthaufen commentedon May 1, 2022
Hey, what do you mean by trimmable? I'm not familiar with the term but I assume some sort of dead-code removal?
albertwoo commentedon May 1, 2022
Here is the article from MS: https://docs.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming
Simply speaking, if this library is not using reflection then is should be ok to add:
But need to verify that.
krauthaufen commentedon May 1, 2022
It is actually using some reflection bits for building cheap(conservarive) equality comparisons
albertwoo commentedon May 1, 2022
It may need extra work to annotate that.
krauthaufen commentedon May 1, 2022
Basically reflection usage quite limited and iirc only used ror generating these equality-comparers, so it should be fairly easy to get that running, for some datastructures there's a specialized cheap equals method afair which is then used by the reflection code. If you want to look for these things yourself
ShallowEqualityis the thing to look for. When I have a little time I can investigate this myself but it might take a few daysCheers
krauthaufen commentedon May 1, 2022
I quickly took a look and it basically boils down to one helper function that is only called via reflection, all the other things should be fine as long as the trimming process doesn't remove fields from types, sadly I also can't offer any guarantees that this will work. Maybe publishing the test-project trimmed could be sufficient to show that nothing crucial gets removed...
krauthaufen commentedon May 1, 2022
Just to be clear here we need to build the core library with net6.0 for that to work right?
sketched support for trimmed publishing #104
krauthaufen commentedon May 1, 2022
I have it running in a branch
trimmed-publishand a very simple test worksI'll test some more things but it looks good so far
krauthaufen commentedon May 1, 2022
After some local tests I think this works. I'm getting properly trimmed binaries and everything I tested still works as intended.
I'll just get a new version out now so you can test your project with it and I expect nothing to break in absence of trimming.
The new version is
1.2.13and should be on nuget any minute.Please let me know if your tests are successful.
Cheers
albertwoo commentedon May 2, 2022
@krauthaufen it works so great. Currently no errors. And the bundle size is 55KB in compressed in br format for my app.
So great!!! Thanks for your great and quick job!!! 👍🚀
krauthaufen commentedon May 2, 2022
Nice, out of curiosity: what are you using it for?
albertwoo commentedon May 2, 2022
I am building a nuget library for F# developers to write blazor application. Similar to bolero but in my own optionated way.
https://github.com/slaveOftime/Fun.Blazor
krauthaufen commentedon May 2, 2022
Cool, nice to see the library in use 👍