JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.0.beta.6.js"></script>
<div id="output"></div>
JavaScript
// template that would be precompilied
Handlebars.templates = {};
Handlebars.templates.myTemplate = Handlebars.compile('<div>Hi, I\'m {{name}}. here\'s a partial: <br />{{partial "myPartial"}}</div>');
// partial that has been converted into a template so that it can be precompilied
Handlebars.templates.myPartial = Handlebars.compile('<span>I\'m a partial inheriting the name {{name}}</span>');
// this is the magic "use templates as partials" helper.
// the new syntax to call a template as a partial is {{partial "templateName"}}
Handlebars.registerHelper('partial', function(templateName,context){
return new Handlebars.SafeString(Handlebars.templates[templateName](this));
});
// boilerplate
$("#output").html(Handlebars.templates.myTemplate({name:"Johnny"}));