Sources
SOY permite la creación de templates en javascript.
One of the more interesting features of Soy templates is that you can extend the templating system.
Essentially, you precompile your .soy file into a .js file using a template compiler (which is written in Java). It's the compiler that you're extending and it's output is what you use in your web app. So you don't directly use the template from JavaScript.