Add `only_new` option to `haxe.macro.Context.onGenerate`
If only_new is set to true then only new types (aka not cached) will be passed to the callback.
@SomeRanDev wants this for Reflaxe.
I'm fine with this, though I'm slightly worried about the overall approach here because we're already at 4 permutations with persistent and new. I can't immediately tell how else to handle this though.
Happy to merge this once Reflaxe/C# is working!
I'd also like to take a proper look at that (monday, if I don't forget about it)
Happy to merge this once Reflaxe/C# is working!
💦💦💦 ... it works... just uhh... 💦 need to use a VERY RESTRICTED subset of Haxe code 💦💦💦
an EnumFlags argument could be nice; could use the int as a key to cleanup the lists into a larger list/PMap.t?
I don't really like the duplication of callback lists for _only_new variants, as (though admittedly that won't matter in 99.9% of cases) order might not be intuitive (all on_generate callbacks with only_new = false run, then all on_generate callbacks with only_new = true)
Can you add a test so that we can try different approaches while still making sure the feature works as expected?