Summary

Soy templates, aka. Google Closure templates, allow devs to use the same template on both in the client and on the server.

Status

API status: experimental
Web resource key: com.atlassian.auiplugin:soy
AMD Module key: N/A
Experimental API: 4.2

Options

AUI is rolling out Soy templates for core components.

In future we hope to offer extracted soydoc and live coding tools, but in the meantime the most popular way to explore the Soy is to read the templates themselves. The templates are commented with usage recommendations; see /auiplugin/src/main/resources/soy/atlassian and test page is http://localhost:9999/ajs/plugins/servlet/ajstest/test-pages/soy/soy-test.html in your refapp.

Conventions

The AUI Soy templates have been built with some common conventions:

  • All should accept id, class, attr, tagName options
  • class and attr will accept a string/array/object as appropriate
  • "content" always means HTML.
    By consequence - value passed to "content" or "*content" suffixed variables will not be auto-escaped. In case of user-generated content - be sure to properly escape values passed as it may result in potential XSS vulnerability.

References