-
Notifications
You must be signed in to change notification settings - Fork 345
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
Initial port to System.Text.Json. #3428
Conversation
@@ -46,7 +46,7 @@ public TraceTelemetryConfig() | |||
/// <remarks>This API is experimental and it may change in future versions of the library without an major version increment</remarks> | |||
public Action<ITelemetryEventPayload> DispatchAction => payload => | |||
{ | |||
var j = new JObject(); | |||
var j = new JsonObject(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this class can be hard deprecated if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already obsoleted. Can't delete it since it affects public API.
Lines 18 to 20 in b9faf12
[Obsolete("Telemetry is sent automatically by MSAL.NET. See https://aka.ms/msal-net-telemetry.", false)] | |
[EditorBrowsable(EditorBrowsableState.Never)] | |
public class TraceTelemetryConfig : ITelemetryConfig |
@pmaytak/@bgavrilMS I've just pushed the changes that added the source generated Json parsing. |
There are still some IL trimming warnings, so this can't be merged as-is yet. Still investigating, but it is probably something that is being generated for a property that shouldn't be. |
Thanks @azchohfi. I'll take a deeper look, but initial thoughts:
|
We should also consider adding a .Net6 target for other platforms, such as Linux/MacOS, so we support trimming for them too. The way the project is structured, we only target net5.0-windows10.0.17763.0, so a Linux project would probably not benefit completely from this. |
As well as a test app with trimming enabled to make sure things are properly trimmed. |
Yeah, this is a must. If we don't, then a simple net6.0 project will reference the netcore app 3.1 TFM, which will have trimming issues since its methods can't be annotated properly. |
@Sergio0694 is it possible to still annotate the one method that is complaining about dynamic access on netcoreapp3.1? |
Btw, this is the call: microsoft-authentication-library-for-dotnet/src/client/Microsoft.Identity.Client/MsalException.cs Line 192 in fe6c9ab
|
Ok, it is definitely working \o/ got all the issues working with this last commit. |
I'll send another PR from a branch of this repo, not from my fork, so it will run the build properly. |
Closed in favor of #3435 |
Fixes #3407
Changes proposed in this request
Removes Newtonsoft.Json, and replaces it with System.Text.Json
Testing
All Unit Tests are passing, but there is more work to be done since this is still not using source generators, so trimming would still affect it.
Performance impact
Performance should greatly improve after the source generators are implemented since no reflection will be used anymore for the Json parsing.