casid / jte

Secure and speedy templates for Java and Kotlin.
https://jte.gg
Apache License 2.0
737 stars 54 forks source link

Tweak docs #313

Closed MariusVolkhart closed 6 months ago

MariusVolkhart commented 6 months ago

Fix some Kotlin code, correct an indent level, and provide some more info on how model code generation replaces precompiled templates.

casid commented 6 months ago

Welcome @MariusVolkhart and thanks for your contributions!

IMHO this note is a bit misleading: This replaces the process of [precompiling templates](pre-compiling.md).

jte-models generates an additional facade so that templates can be called through that facade. But behind the scenes it either calls the templates dynamically and compiles them on demand (good for development, bad for production), or it calls the previously generated/precompiled template methods (bad for development, good for production).

MariusVolkhart commented 6 months ago

Fair point! I was trying to convey that when using the generate stage at build time, you can't also use the pre-compile stage. I found myself spending a fair bit of time trying to wrap my head around the relationship/tradeoff between binary encoding, precompile on-disk, precompile in classpath, and generated models. I'll work on the wording for this.

MariusVolkhart commented 6 months ago

@casid I took another stab at this, this time linking more liberally between the strategies (binary encoding, pre-compiled, and facade). I would appreciate you giving this another look and any feedback you might have.

casid commented 6 months ago

Looks good, thank you so much!