tschuehly / spring-view-component

Server-side UI components with spring boot
MIT License
209 stars 11 forks source link

JTE flavor pulls in kotlin-compiler-embeddable #18

Closed MariusSp closed 7 months ago

MariusSp commented 8 months ago

I setup a Java project with JTE for templating. spring-view-component-jte pulls in jte AND jte-kotlin. The latter includes kotlin-compiler-embeddable.

[INFO] +- de.tschuehly:spring-view-component-jte:jar:0.7.2:compile
[INFO] |  +- gg.jte:jte:jar:3.1.9:compile
[INFO] |  |  +- gg.jte:jte-runtime:jar:3.1.9:compile
[INFO] |  |  \- gg.jte:jte-extension-api:jar:3.1.9:compile
[INFO] |  +- gg.jte:jte-kotlin:jar:3.1.0:compile
[INFO] |  |  \- org.jetbrains.kotlin:kotlin-compiler-embeddable:jar:1.9.22:compile
[INFO] |  \- gg.jte:jte-spring-boot-starter-3:jar:3.1.9:runtime

This increases the size of a fat jar drastically (+57MB).

Is this necessary for pure Java projects? I'm not familiar with the Kotlin cosmos and at least JTE seems to have a standalone Java version.

tschuehly commented 8 months ago

Hello @MariusSp,

spring-view-component-jte currently supports both Kotlin and Java. For this both dependencies are needed. We would need to publish an additional spring-view-component-kte dependency I think. I think the dependency structure can be improved immensely, if you are up to it I gladly welcome your Pull Request!

Greetings Thomas

MariusSp commented 8 months ago

I opened a pull request with an proposal. Let me know your opinion, not sure if this is the right way.

Unfortunately I don't have any gradle experience... So no improvements in that departement...

A revised structure might be helpful. The HTMX stuff could be extracted to its own module/extension, too.

tschuehly commented 8 months ago

@MariusSp

Thank you! I will take a look tomorrow!

Yes I was also thinking about extracting the HTMX stuff also but it's a lot of work to make it really modular.