PERF: cache information about missing view classes.

This commit is contained in:
Sam 2015-11-21 23:40:22 +11:00
parent d75ea1a0ea
commit 7038d5f1c4
1 changed files with 6 additions and 1 deletions

View File

@ -1,12 +1,17 @@
import registerUnbound from 'discourse/helpers/register-unbound';
// see: https://github.com/emberjs/ember.js/issues/12634
var missingViews = {};
function renderRaw(ctx, template, templateName, params) {
params.parent = params.parent || ctx;
if (!params.view) {
if (!params.view && !missingViews[templateName]) {
var viewClass = Discourse.__container__.lookupFactory('view:' + templateName);
if (viewClass) {
params.view = viewClass.create(params);
} else {
missingViews[templateName] = true;
}
}