diff --git a/bower.json b/bower.json index 9770b9fb..b11ed158 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating", - "version": "0.8.9", + "version": "0.8.10", "description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.", "keywords": [ "aurelia", diff --git a/dist/amd/resource-coordinator.js b/dist/amd/resource-coordinator.js index 1a7250b6..66e1dceb 100644 --- a/dist/amd/resource-coordinator.js +++ b/dist/amd/resource-coordinator.js @@ -30,7 +30,6 @@ define(["exports", "aurelia-loader", "aurelia-path", "aurelia-dependency-injecti this.container = container; this.viewEngine = viewEngine; this.importedModules = {}; - this.importedAnonymous = {}; this.appResources = appResources; viewEngine.resourceCoordinator = this; } @@ -46,14 +45,14 @@ define(["exports", "aurelia-loader", "aurelia-path", "aurelia-dependency-injecti }, { getExistingModuleAnalysis: { value: function getExistingModuleAnalysis(id) { - return this.importedModules[id] || this.importedAnonymous[id]; + return this.importedModules[id]; }, writable: true, configurable: true }, loadViewModelInfo: { value: function loadViewModelInfo(moduleImport, moduleMember) { - return this._loadAndAnalyzeModuleForElement(moduleImport, moduleMember, this.importedAnonymous); + return this._loadAndAnalyzeModuleForElement(moduleImport, moduleMember); }, writable: true, configurable: true @@ -79,7 +78,7 @@ define(["exports", "aurelia-loader", "aurelia-path", "aurelia-dependency-injecti _loadAndAnalyzeModuleForElement: { value: function _loadAndAnalyzeModuleForElement(moduleImport, moduleMember, cache) { var _this = this; - var existing = cache[moduleImport]; + var existing = cache && cache[moduleImport]; if (existing) { return Promise.resolve(existing.element); @@ -111,7 +110,9 @@ define(["exports", "aurelia-loader", "aurelia-path", "aurelia-dependency-injecti } } - cache[analysis.id] = analysis; + if (cache) { + cache[analysis.id] = analysis; + } return Promise.all(loads).then(function () { return analysis.element; diff --git a/dist/commonjs/resource-coordinator.js b/dist/commonjs/resource-coordinator.js index 9fcb39af..190386f5 100644 --- a/dist/commonjs/resource-coordinator.js +++ b/dist/commonjs/resource-coordinator.js @@ -33,7 +33,6 @@ var ResourceCoordinator = exports.ResourceCoordinator = (function () { this.container = container; this.viewEngine = viewEngine; this.importedModules = {}; - this.importedAnonymous = {}; this.appResources = appResources; viewEngine.resourceCoordinator = this; } @@ -49,14 +48,14 @@ var ResourceCoordinator = exports.ResourceCoordinator = (function () { }, { getExistingModuleAnalysis: { value: function getExistingModuleAnalysis(id) { - return this.importedModules[id] || this.importedAnonymous[id]; + return this.importedModules[id]; }, writable: true, configurable: true }, loadViewModelInfo: { value: function loadViewModelInfo(moduleImport, moduleMember) { - return this._loadAndAnalyzeModuleForElement(moduleImport, moduleMember, this.importedAnonymous); + return this._loadAndAnalyzeModuleForElement(moduleImport, moduleMember); }, writable: true, configurable: true @@ -82,7 +81,7 @@ var ResourceCoordinator = exports.ResourceCoordinator = (function () { _loadAndAnalyzeModuleForElement: { value: function _loadAndAnalyzeModuleForElement(moduleImport, moduleMember, cache) { var _this = this; - var existing = cache[moduleImport]; + var existing = cache && cache[moduleImport]; if (existing) { return Promise.resolve(existing.element); @@ -114,7 +113,9 @@ var ResourceCoordinator = exports.ResourceCoordinator = (function () { } } - cache[analysis.id] = analysis; + if (cache) { + cache[analysis.id] = analysis; + } return Promise.all(loads).then(function () { return analysis.element; diff --git a/dist/es6/resource-coordinator.js b/dist/es6/resource-coordinator.js index d1ddd189..2cfc655b 100644 --- a/dist/es6/resource-coordinator.js +++ b/dist/es6/resource-coordinator.js @@ -22,17 +22,16 @@ export class ResourceCoordinator { this.container = container; this.viewEngine = viewEngine; this.importedModules = {}; - this.importedAnonymous = {}; this.appResources = appResources; viewEngine.resourceCoordinator = this; } getExistingModuleAnalysis(id){ - return this.importedModules[id] || this.importedAnonymous[id]; + return this.importedModules[id]; } loadViewModelInfo(moduleImport, moduleMember){ - return this._loadAndAnalyzeModuleForElement(moduleImport, moduleMember, this.importedAnonymous); + return this._loadAndAnalyzeModuleForElement(moduleImport, moduleMember); } loadElement(moduleImport, moduleMember, viewStategy){ @@ -50,7 +49,7 @@ export class ResourceCoordinator { } _loadAndAnalyzeModuleForElement(moduleImport, moduleMember, cache){ - var existing = cache[moduleImport]; + var existing = cache && cache[moduleImport]; if(existing){ return Promise.resolve(existing.element); @@ -78,14 +77,16 @@ export class ResourceCoordinator { } } - cache[analysis.id] = analysis; + if(cache){ + cache[analysis.id] = analysis; + } return Promise.all(loads).then(() => analysis.element); }); } importResources(imports, resourceManifestUrl){ - var i, ii, current, annotation, existing, + var i, ii, current, annotation, existing, lookup = {}, finalModules = [], importIds = [], analysis, type; @@ -96,7 +97,7 @@ export class ResourceCoordinator { current = imports[i]; annotation = Origin.get(current); - if(!annotation){ + if(!annotation){ analysis = analyzeModule({'default':current}); analysis.analyze(container); type = (analysis.element || analysis.resources[0]).type; @@ -106,7 +107,7 @@ export class ResourceCoordinator { }else{ annotation = new Origin(join(this.appResources.baseResourceUrl, type.name)); } - + Origin.set(current, annotation); } @@ -215,7 +216,7 @@ class ResourceModule { } analyze(container){ - var current = this.element, + var current = this.element, resources = this.resources, i, ii; @@ -258,7 +259,7 @@ function analyzeModule(moduleInstance, viewModelMember){ if(typeof moduleInstance === 'function'){ moduleInstance = {'default': moduleInstance}; } - + if(viewModelMember){ viewModelType = moduleInstance[viewModelMember]; } diff --git a/dist/system/resource-coordinator.js b/dist/system/resource-coordinator.js index 4b75cc71..e5527b0c 100644 --- a/dist/system/resource-coordinator.js +++ b/dist/system/resource-coordinator.js @@ -107,7 +107,6 @@ System.register(["aurelia-loader", "aurelia-path", "aurelia-dependency-injection this.container = container; this.viewEngine = viewEngine; this.importedModules = {}; - this.importedAnonymous = {}; this.appResources = appResources; viewEngine.resourceCoordinator = this; } @@ -123,14 +122,14 @@ System.register(["aurelia-loader", "aurelia-path", "aurelia-dependency-injection }, { getExistingModuleAnalysis: { value: function getExistingModuleAnalysis(id) { - return this.importedModules[id] || this.importedAnonymous[id]; + return this.importedModules[id]; }, writable: true, configurable: true }, loadViewModelInfo: { value: function loadViewModelInfo(moduleImport, moduleMember) { - return this._loadAndAnalyzeModuleForElement(moduleImport, moduleMember, this.importedAnonymous); + return this._loadAndAnalyzeModuleForElement(moduleImport, moduleMember); }, writable: true, configurable: true @@ -156,7 +155,7 @@ System.register(["aurelia-loader", "aurelia-path", "aurelia-dependency-injection _loadAndAnalyzeModuleForElement: { value: function _loadAndAnalyzeModuleForElement(moduleImport, moduleMember, cache) { var _this = this; - var existing = cache[moduleImport]; + var existing = cache && cache[moduleImport]; if (existing) { return Promise.resolve(existing.element); @@ -188,7 +187,9 @@ System.register(["aurelia-loader", "aurelia-path", "aurelia-dependency-injection } } - cache[analysis.id] = analysis; + if (cache) { + cache[analysis.id] = analysis; + } return Promise.all(loads).then(function () { return analysis.element; diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 50419e45..5d4babe2 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,12 @@ +### 0.8.10 (2015-02-13) + + +#### Bug Fixes + +* **build:** add missing bower bump ([4484ea7f](http://github.com/aurelia/templating/commit/4484ea7f302d0faca3a0f48b218b9a0b8a00bd46)) +* **resource-coordinator:** do not cache dynamic view models ([a29f2bc2](http://github.com/aurelia/templating/commit/a29f2bc2a8a8c3fc40265b310646587ee0601d55)) + + ### 0.8.9 (2015-02-06) diff --git a/package.json b/package.json index 93aee5e7..adfef723 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating", - "version": "0.8.9", + "version": "0.8.10", "description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.", "keywords": [ "aurelia",