EventFlow
EventFlow copied to clipboard
Replace JSON.NET with System.Text.Json
.NET Core 3.0 is coming with the new System.Text.Json API with much better performance than JSON.NET, what do you think of replacing it with the new API?
You can use it today already, simple provide an implementation that implements IJsonSerializer and EventFlow will use that instead.
Right now EventFlow targets .NET Framework 4.5.2 and System.Text.Json requires 4.6.1. I'm not sure that increasing the framework requirement for improved performance is a good idea, especially when you can change the implementation.
Might consider using different JSON implementations for different frameworks, i.e., System.Text.Json for .NET Standard and then JSON.NET for .NET Framework.
Might consider using different JSON implementations for different frameworks, i.e., System.Text.Json for .NET Standard and then JSON.NET for .NET Framework.
Looks good to me 👍
One thing to bear in mind is that STJ doesnt necessary have 100% compatibility with json.net conventions and doesn't honor json.net Converters that one might be reliant on. The choice of serializer and settings is definitely not something one'd want to happen without an explicit change somewhere - i.e. I'd expect to at least need to change a line of code to opt in.
@bartelink agree
I have submitted PR #760 that allows for more flexible use of serializers, basically not just lock in one string based serialization. I'm very much interested in your feedback.
how are things progressing re System.Text.Json? I am corrently working on a project that uses System.Text.Json as primary JSON serialization library, but I still have to duplicate large portions of JSON serialization/deserialization logic to be able to use EventFlow, which is kinda pain in the butt.
@Yaevh should implementing IEventJsonSerializer be enough?
But it something I would like to do for 1.0
I've been playing around with System.Text.Json and noticed two differences from Netwonsoft.Json:
- System.Text.Json treats empty JSON as invalid and throws
JsonException; Newtonsoft.Json deserializes it tonull - Newtonsoft.Json can deserialize enum from both int value and name; System.Text.Json handles int value only
Can we live with these limitations?
Hello there!
We hope you are doing well. We noticed that this issue has not seen any activity in the past 90 days. We consider this issue to be stale and will be closing it within the next seven days.
If you still require assistance with this issue, please feel free to reopen it or create a new issue.
Thank you for your understanding and cooperation.
Best regards, EventFlow
Hello there!
This issue has been closed due to inactivity for seven days. If you believe this issue still needs attention, please feel free to open a new issue or comment on this one to request its reopening.
Thank you for your contribution to this repository.
Best regards, EventFlow