Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adjusting default configuration for preloadTemplates

  • Loading branch information...
commit 2d11a68b9653ea6b7f052dc18d476d224cb2fae4 1 parent 012315d
@caridy authored
View
2  lib/app/autoload/mojito-client.client.js
@@ -71,7 +71,7 @@ YUI.add('mojito-client', function(Y, NAME) {
data.mojit_assets = data.mojit_assets || mp._assetsRoot;
mojitView = mp._views[view];
- renderer = Y.mojito.ViewRenderer(mojitView.engine, viewEngine);
+ renderer = new Y.mojito.ViewRenderer(mojitView.engine, viewEngine);
Y.log('Rendering "' + view + '" in Binder', 'debug', NAME);
renderer.render(data, mp.type, mojitView['content-path'], {
View
9 lib/app/autoload/store.server.js
@@ -616,8 +616,7 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
ress,
r,
res,
- template,
- staticAppConfig = this.getStaticAppConfig();
+ template;
if ('shared' === mojitType) {
throw new Error('Mojit name "shared" is special and isn\'t a real mojit.');
@@ -677,7 +676,7 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
if (res.type === 'view') {
template = {
'content-path': (env === 'client' ?
- this._libs.path.join(staticAppConfig.pathToRoot || '', res.url) :
+ this._libs.path.join(this._appConfigStatic.pathToRoot || '', res.url) :
res.source.fs.fullPath),
'content': res.content,
'engine': res.view.engine
@@ -1382,9 +1381,7 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
res.name = this._libs.path.join(fs.subDirArray.join('/'), baseParts.join('.'));
res.id = [res.type, res.subtype, res.name].join('-');
// for performance reasons, we might want to preload all
- // views in memory, for that, we can use:
- // application.json->viewEngine->preloadTemplates
- // TODO: should this be set to true by default?
+ // views in memory.
if (this._appConfigStatic.viewEngine && this._appConfigStatic.viewEngine.preloadTemplates) {
res.content = this._libs.fs.readFileSync(source.fs.fullPath, 'utf8');
}
View
3  lib/config.json
@@ -25,6 +25,9 @@
},
"staticHandling": {
"prefix": "static"
+ },
+ "viewEngine": {
+ "preloadTemplates": false
}
},
"defaultRoutes" : {
Please sign in to comment.
Something went wrong with that request. Please try again.