Closed casid closed 1 year ago
I'm not a user of Jte but I have played with lots of templating engines and one of the things I think Rocker got right is the ability to refer to a template as a type. JStachio inherently relies on this as well.
For example in JStachio and Rocker there is no:
JStachio.render("someTemplateName");
This is similar to the points brought up in #131 and arguably it belongs there.
So I'm wondering if you provide an interface like:
interface TemplateReference<PARAM> {
public String templateName(); // name() is not chosen because we might use enum
}
<P> void TemplateEngine.render(TemplateReference<P> template, P param, Output o)
Then you somehow generate those TemplateReferences.
That being said generating code and then having someone reference the symbol of that code is painful which is exactly the case with Rocker. ie red squiggle because the IDE doesn't see the class. You can fix this with proper classpath setup but its annoying.
@agentgt the ability to do that was implemented in #224.
jte 3 is finally out, closing this now!
We're planning to release the next major jte version. So far, we have the following ideas:
229
224
generateNativeImageResources
feature with an extension.235
227
getWriter()
fromTemplateOutput
interface226
What do you think? Do you have other ideas we should incorporate in this release?