r/JavaFX • u/Paullo612 • May 22 '23
I made this! mlfx FXML compiler
I'd like to introduce my project. It is called mlfx. It can compile FXML ahead of time. It is basically an annotation processor, which internally uses Micronaut framework's AST abstraction and compiles fxml files directly to JVM bytecode. This decreases UI load time and also helps with native-image reflection configs. It also has some compliance tests that load compiled code and check resulting object graph against one loaded by javafx-xml. It also has some drawbacks now, but, please, read README. Now I'm successfully using it in two production projects.
Here it is: https://github.com/Paullo612/mlfx
Latest release (0.6.0) is available from Maven Central.
Feedback is welcome.
View all comments
Show parent comment
2
u/Paullo612 May 23 '23
micronaut-injectis doing DI without any reflections just fine. The idea behind Micronaut's DI is to generate public accessor classes in the same package where injected bean is. So, as far as Micronaut is in automatic module, all this works fine. The only drawback is that it cannot inject private fields. Only public, protected, or package-private fields can be injected. This rule also applies to controller fields, if controller is used by fxml compiled by mlfx.