Skip to content

Add only_new option to haxe.macro.Context.onGenerate #12286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

Apprentice-Alchemist
Copy link
Contributor

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.

@Simn
Copy link
Member

Simn commented Jun 21, 2025

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!

@kLabz
Copy link
Contributor

kLabz commented Jun 21, 2025

I'd also like to take a proper look at that (monday, if I don't forget about it)

@SomeRanDev
Copy link
Contributor

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?

@skial skial mentioned this pull request Jun 25, 2025
1 task
@kLabz
Copy link
Contributor

kLabz commented Jul 1, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants