obs-websocket-dotnet
obs-websocket-dotnet copied to clipboard
feat: Introduce System.Text.Json for AOT Compatibility
This change aims to improve the project's compatibility with AOT (Ahead-Of-Time) compilation environments.
Key Changes:
- Replaced all usages of
Newtonsoft.Json.Linq.JObjectwithSystem.Text.Jsonrelated APIs to support AOT compilation optimizations in .NET 8 and later versions. - This modification should reduce runtime reflection, leading to improved startup times and reduced memory footprint.
Motivation:
The original JObject implementation could lead to compatibility issues in AOT compilation mode, potentially preventing the application from starting or running correctly. System.Text.Json is the officially recommended JSON processing library by .NET and offers better support for AOT compilation.
Important Notes for Reviewer:
- Test Project: I have not modified the project's existing test code. I've performed basic local tests on the core functionalities to ensure JSON serialization and deserialization operations work as expected.
-
Recommendation: Given that this change impacts the project's data processing logic, it is highly recommended that the project owner performs a comprehensive review and full regression testing before merging this Pull Request. This will help ensure all functionalities operate correctly and as expected under the
System.Text.Jsonenvironment. -
Potential Impact: While
System.Text.Jsonbehaves similarly toJObjectin most cases, there might be subtle differences in certain edge cases (e.g., specific JSON format parsing behaviors). It's advisable to review relevant data processing logic.
Thank you for your review!