microsoft / RulesEngine

A Json based Rules Engine with extensive Dynamic expression support
https://microsoft.github.io/RulesEngine/
MIT License
3.47k stars 528 forks source link

AOT compatibility, and move to System.Text.Json #594

Open HalvorNygaard opened 3 months ago

HalvorNygaard commented 3 months ago

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?

madhon commented 2 months ago

any comments @abbasc52 ?

asulwer commented 1 week ago

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

Migrate from Newtonsoft.Json

HalvorNygaard commented 1 week ago

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.

asulwer commented 1 week ago

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

RenanCarlosPereira commented 2 days ago

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

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