fluentui-blazor icon indicating copy to clipboard operation
fluentui-blazor copied to clipboard

fix: Remove usage of `DebuggerSupport` and `TrimmerRemoveSymbols` on release build

Open bruno-garcia opened this issue 1 year ago • 1 comments

Arguably a bug report but using TrimmerRemoveSymbols makes it harder to debug things in release builds.

Symbols are usually trimmed to match the trimmed assemblies.

The default behavior should already include smaller symbols. By default .NET splits them (dll/exe + pdb only for symbols). With Portable PDBs they are already quite small. And can be published on snupkg packages and published to nuget.org. Debugger and other tools (such as sentry.io) can fetch the symbols from prod stack traces to add line numbers and file paths, as well as use source link to link to the original source code and fetch surrounding lines of code on stack traces. Source link info lives in the PDB.

So instead of removing symbols we can leave the default behavior, and publish a snupkg making the nupkg itself smaller while bugs easier to resolve.

Finally, using DebuggerSupport=false makes TrimmerRemoveSymbols redundant so we'd need to remove both ones:

https://github.com/microsoft/fluentui-blazor/blob/3b5c94354e4ca9ffc9cebcd794f3e1974db5e40e/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj#L40-L41

I'm happy to make the changes if we agree on this

bruno-garcia avatar Feb 17 '24 03:02 bruno-garcia

Hello. Yes that could be a good idea. Could you also verify the SourceLink like describe here? https://www.meziantou.net/how-to-debug-nuget-packages-using-sourcelink.htm#test-sourcelink-is-e

dvoituron avatar Feb 17 '24 17:02 dvoituron

Hi Bruno, would still love to get these changes in. You have some time soon to commit them?

vnbaaij avatar Mar 08 '24 11:03 vnbaaij

Sorry I haven't had the time, if anyone wants to take this over please feel free, I don't want to block it

bruno-garcia avatar Mar 10 '24 21:03 bruno-garcia

Ok, we will take it over.

vnbaaij avatar Mar 11 '24 12:03 vnbaaij

Thank you!

bruno-garcia avatar Mar 15 '24 17:03 bruno-garcia