I am currently researching templating frameworks that have implementations for both JavaScript and Grails/Java for an upcoming project that will render templates both within a Grails application and on the front end.
The requirements are as follows:
So far, I have investigated Mustache which has JavaScript and Java implementations, and Haml which has JavaScript and Grails implementations. (I would link the implementations, but as a new user I am only able to add 2 links.)
I would be grateful for any experience others have had with these, and any recommendations for other frameworks that may fit the above needs.
Did you look at Closure Templates? There's also a Grails plug-in. It meets most if not all your requirements.
I've used both Mustache and Haml at one point or another. If you hadn't mentioned either, I would probably have recommended Mustache as a pure templating solution. Haml is great, but it is more a replacement for authoring html (i.e. you don't write html any more, you write haml). Mustache on the other hand is all about templating
I think either one would be a fine choice. Mustache.js is mature, the java implementation is probably less so, but it has been around for a little while, so you're probably ok in that regard. I am not sure how mature the javascript or grails Haml implementations are.
I'd be leaning towards Mustache if all you're after is templating, it is very good although it takes a little while to get used to the whole {{}} syntax. But if you're attracted to Haml as a replacement for writing HTML it might tip you in that direction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With