I figured out a way to use a helper to convert the handlebars templates to a string and creating a document fragment.
import Ember from 'ember';
export function helper(data/*, hash*/) {
let precompiledTemplateFunction = Handlebars.templates[data[0]];
return fragmentFromString(precompiledTemplateFunction());
}
function fragmentFromString(strHTML) {
return document.createRange().createContextualFragment(strHTML);
}
export default Ember.Helper.helper(helper);
usage: {{helper 'precompiledTemplate'}}
I'm importing the templates in the ember-cli-build.js file app.import('vendor/path/to/precompiled/template');
I haven't dealt with passing in attributes through the helper but I don't think it will be that hard.