RulesEngine icon indicating copy to clipboard operation
RulesEngine copied to clipboard

AOT compatibility, and move to System.Text.Json

Open HalvorNygaard opened this issue 1 year ago • 5 comments

Is there a plan to move from Newtonsoft.Json to System.Text.Json? Will this make RulesEngine AOT compatible, or is there still other logic relying on reflection? Is there ways to use RulesEngine with AOT today?

HalvorNygaard avatar Mar 05 '24 12:03 HalvorNygaard

any comments @abbasc52 ?

madhon avatar Apr 24 '24 10:04 madhon

System.Text.Json is restrictive, has lots of checks in that. lots of work for no real benefit

Migrate from Newtonsoft.Json

asulwer avatar Jun 21 '24 00:06 asulwer

Well the question was concerning the AOT compatibilty, as Microsoft changed up a lot of internals of ASP.NET to make it AOT compatible, I would guess within a year or two you will have to use aot compilation to get the most out of it. So the benefit would to also be able to use it it projects built for AOT compilation.

Just came across the issue when i tried to compile a .NET app AOT, haven't tested out the proposed fix myself, so I don't know what the implications of swapping the json serializer are.

HalvorNygaard avatar Jun 24 '24 05:06 HalvorNygaard

swapping would mean reinventing code that Newtonsoft.Json provides and System.Text.Json does not. i am not saying its off the table, maybe a future lite version. regardless this project is dead and my fork is not

asulwer avatar Jun 24 '24 16:06 asulwer

@madhon please check out this PR: I just migrated it, and everything looks fine 😎

https://github.com/asulwer/RulesEngine/pull/32

RenanCarlosPereira avatar Jun 30 '24 17:06 RenanCarlosPereira