LiquidBounce icon indicating copy to clipboard operation
LiquidBounce copied to clipboard

feat: dynamic feature registration

Open ccetl opened this issue 1 year ago • 5 comments

What does this PR add? This PR adds annotation processors that automatically collect implementations at compile time. This is done using Kotlin Symbol Processing (KSP).

Why? The motivation behind this is removing and adding modules without having to edit the ModuleManager class what would make module creation/removal easier and faster.

Changes

  • [x] Implement the module processor
  • [x] Implement the command processor
  • [x] Implement only in dev option for modules and commands

ccetl avatar Sep 05 '24 15:09 ccetl

I did not know about those kotlin processors yet. This is definitely a cool feature. But it does not bring a big benifit to the code base while making it more complicated for new contributors. Sure it is like 5s faster to add a new module which took 2h to make (+ 0.069 % efficiency)

+0.069% efficiency is better than +0 :pray:

larryngton2 avatar Sep 09 '24 18:09 larryngton2

@1zun4 @SenkJu opinion?

superblaubeere27 avatar Sep 09 '24 19:09 superblaubeere27

It looks like SpringBoot annotations 😄

MukjepScarlet avatar Oct 10 '24 14:10 MukjepScarlet

@1zun4 @SenkJu opinion?

Looks fine to me. Should be merged before too many conflicts appear.

1zun4 avatar Oct 10 '24 15:10 1zun4

I'm not sure what exactly this does. Since it doesn't affect my code, @1zun4 and @superblaubeere27 should decide.

SenkJu avatar Oct 10 '24 16:10 SenkJu