mustache.java icon indicating copy to clipboard operation
mustache.java copied to clipboard

Lambda context support (for JStachio fallback)

Open agentgt opened this issue 1 year ago • 0 comments

So I recently early released a mustache type checked library called JStachio: https://github.com/jstachio/jstachio

While it may seems like JStachio is a competing Mustache implementation I think its complementary to both this library and JMustache. It actually can help users of mustache.java for type checking structured models (jstachio is not good at Map<String,?> models) while delegating to mustache.java for dynamic models.

JStachio delegating to either JMustache or mustache.java also allows more rapid development of templates as unfortunately incremental compilation via annotation processor for resources is problematic. Then in production one can turn off delegating and rely on the jstachio generated java code or not.

Anyway I could not figure out how to get a 1:1 support of lambdas in JStachio to mustache.java like I was with JMustache because it appears there is no way to get context from a lambda.

Is that correct? Am I missing something? I realize this isn't really part of the mustache spec but many implementations allow access.

Regardless @spullara any feedback on the library would be greatly appreciated.

agentgt avatar Nov 10 '22 15:11 agentgt