From 9a8861c00d2ad6e75bc59f88006c274561018ace Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Sun, 25 Jan 2015 16:27:30 -0500 Subject: [PATCH] chore(all): prepare release 0.8.5 --- bower.json | 2 +- dist/amd/attached-behavior.js | 9 ++++++- dist/amd/custom-element.js | 10 ++------ dist/amd/resource-coordinator.js | 34 ++++++++++++++++++++++++++- dist/amd/template-controller.js | 9 ++++++- dist/commonjs/attached-behavior.js | 9 ++++++- dist/commonjs/custom-element.js | 10 ++------ dist/commonjs/resource-coordinator.js | 34 ++++++++++++++++++++++++++- dist/commonjs/template-controller.js | 9 ++++++- dist/es6/attached-behavior.js | 5 +++- dist/es6/custom-element.js | 8 +------ dist/es6/resource-coordinator.js | 33 ++++++++++++++++++++++---- dist/es6/template-controller.js | 5 +++- dist/system/attached-behavior.js | 9 ++++++- dist/system/custom-element.js | 10 ++------ dist/system/resource-coordinator.js | 34 ++++++++++++++++++++++++++- dist/system/template-controller.js | 9 ++++++- doc/CHANGELOG.md | 8 +++++++ package.json | 2 +- 19 files changed, 201 insertions(+), 48 deletions(-) diff --git a/bower.json b/bower.json index 7fe7aed3..4694f91a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating", - "version": "0.8.4", + "version": "0.8.5", "description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.", "keywords": [ "aurelia", diff --git a/dist/amd/attached-behavior.js b/dist/amd/attached-behavior.js index dd69d97c..20425e17 100644 --- a/dist/amd/attached-behavior.js +++ b/dist/amd/attached-behavior.js @@ -46,9 +46,16 @@ define(["exports", "aurelia-metadata", "./behavior-instance", "./behaviors", "./ configurable: true } }, { + analyze: { + value: function analyze(container, target) { + configureBehavior(container, this, target); + }, + writable: true, + enumerable: true, + configurable: true + }, load: { value: function load(container, target) { - configureBehavior(container, this, target); return Promise.resolve(this); }, writable: true, diff --git a/dist/amd/custom-element.js b/dist/amd/custom-element.js index 6bee6dc3..b193d153 100644 --- a/dist/amd/custom-element.js +++ b/dist/amd/custom-element.js @@ -61,12 +61,8 @@ define(["exports", "aurelia-metadata", "./behavior-instance", "./behaviors", "./ configurable: true } }, { - configure: { - value: function configure(container, target) { - if (this.configured) { - return; - } - + analyze: { + value: function analyze(container, target) { configureBehavior(container, this, target, valuePropertyName); this.configured = true; @@ -82,8 +78,6 @@ define(["exports", "aurelia-metadata", "./behavior-instance", "./behaviors", "./ var _this = this; var options; - this.configure(container, target); - viewStrategy = viewStrategy || ViewStrategy.getDefault(target); options = { targetShadowDOM: this.targetShadowDOM }; diff --git a/dist/amd/resource-coordinator.js b/dist/amd/resource-coordinator.js index 50f098a0..b61a11f3 100644 --- a/dist/amd/resource-coordinator.js +++ b/dist/amd/resource-coordinator.js @@ -106,6 +106,8 @@ define(["exports", "aurelia-loader", "aurelia-path", "aurelia-dependency-injecti throw new Error("No element found in module \"" + moduleImport + "\"."); } + analysis.analyze(container); + for (i = 0, ii = resources.length; i < ii; ++i) { current = resources[i]; type = current.type; @@ -119,7 +121,6 @@ define(["exports", "aurelia-loader", "aurelia-path", "aurelia-dependency-injecti cache[analysis.id] = analysis; return Promise.all(loads).then(function () { - analysis.element.type.configure(container, analysis.element.value); return analysis.element; }); }); @@ -141,12 +142,15 @@ define(["exports", "aurelia-loader", "aurelia-path", "aurelia-dependency-injecti analysis, type; + var container = this.container; + for (i = 0, ii = imports.length; i < ii; ++i) { current = imports[i]; annotation = Origin.get(current); if (!annotation) { analysis = analyzeModule({ "default": current }); + analysis.analyze(container); type = (analysis.element || analysis.resources[0]).type; if (resourceManifestUrl) { @@ -230,6 +234,7 @@ define(["exports", "aurelia-loader", "aurelia-path", "aurelia-dependency-injecti } analysis = analyzeModule(imports[i]); + analysis.analyze(container); existing[analysis.id] = analysis; allAnalysis[i] = analysis; resources = analysis.resources; @@ -290,6 +295,33 @@ define(["exports", "aurelia-loader", "aurelia-path", "aurelia-dependency-injecti } _prototypeProperties(ResourceModule, null, { + analyze: { + value: function analyze(container) { + var current = this.element, + resources = this.resources, + i, + ii; + + if (current) { + if (!current.type.isAnalyzed) { + current.type.isAnalyzed = true; + current.type.analyze(container, current.value); + } + } + + for (i = 0, ii = resources.length; i < ii; ++i) { + current = resources[i]; + + if ("analyze" in current.type && !current.type.isAnalyzed) { + current.type.isAnalyzed = true; + current.type.analyze(container, current.value); + } + } + }, + writable: true, + enumerable: true, + configurable: true + }, register: { value: function register(registry, name) { var i, diff --git a/dist/amd/template-controller.js b/dist/amd/template-controller.js index 60c983c5..39dc3da4 100644 --- a/dist/amd/template-controller.js +++ b/dist/amd/template-controller.js @@ -47,9 +47,16 @@ define(["exports", "aurelia-metadata", "./behavior-instance", "./behaviors", "./ configurable: true } }, { + analyze: { + value: function analyze(container, target) { + configureBehavior(container, this, target); + }, + writable: true, + enumerable: true, + configurable: true + }, load: { value: function load(container, target) { - configureBehavior(container, this, target); return Promise.resolve(this); }, writable: true, diff --git a/dist/commonjs/attached-behavior.js b/dist/commonjs/attached-behavior.js index 9d678e90..7fcc507c 100644 --- a/dist/commonjs/attached-behavior.js +++ b/dist/commonjs/attached-behavior.js @@ -45,9 +45,16 @@ var AttachedBehavior = (function (ResourceType) { configurable: true } }, { + analyze: { + value: function analyze(container, target) { + configureBehavior(container, this, target); + }, + writable: true, + enumerable: true, + configurable: true + }, load: { value: function load(container, target) { - configureBehavior(container, this, target); return Promise.resolve(this); }, writable: true, diff --git a/dist/commonjs/custom-element.js b/dist/commonjs/custom-element.js index 309ebfa3..5b9909a1 100644 --- a/dist/commonjs/custom-element.js +++ b/dist/commonjs/custom-element.js @@ -60,12 +60,8 @@ var CustomElement = (function (ResourceType) { configurable: true } }, { - configure: { - value: function configure(container, target) { - if (this.configured) { - return; - } - + analyze: { + value: function analyze(container, target) { configureBehavior(container, this, target, valuePropertyName); this.configured = true; @@ -81,8 +77,6 @@ var CustomElement = (function (ResourceType) { var _this = this; var options; - this.configure(container, target); - viewStrategy = viewStrategy || ViewStrategy.getDefault(target); options = { targetShadowDOM: this.targetShadowDOM }; diff --git a/dist/commonjs/resource-coordinator.js b/dist/commonjs/resource-coordinator.js index d4970f20..ebfef3e5 100644 --- a/dist/commonjs/resource-coordinator.js +++ b/dist/commonjs/resource-coordinator.js @@ -105,6 +105,8 @@ var ResourceCoordinator = (function () { throw new Error("No element found in module \"" + moduleImport + "\"."); } + analysis.analyze(container); + for (i = 0, ii = resources.length; i < ii; ++i) { current = resources[i]; type = current.type; @@ -118,7 +120,6 @@ var ResourceCoordinator = (function () { cache[analysis.id] = analysis; return Promise.all(loads).then(function () { - analysis.element.type.configure(container, analysis.element.value); return analysis.element; }); }); @@ -140,12 +141,15 @@ var ResourceCoordinator = (function () { analysis, type; + var container = this.container; + for (i = 0, ii = imports.length; i < ii; ++i) { current = imports[i]; annotation = Origin.get(current); if (!annotation) { analysis = analyzeModule({ "default": current }); + analysis.analyze(container); type = (analysis.element || analysis.resources[0]).type; if (resourceManifestUrl) { @@ -229,6 +233,7 @@ var ResourceCoordinator = (function () { } analysis = analyzeModule(imports[i]); + analysis.analyze(container); existing[analysis.id] = analysis; allAnalysis[i] = analysis; resources = analysis.resources; @@ -289,6 +294,33 @@ var ResourceModule = (function () { } _prototypeProperties(ResourceModule, null, { + analyze: { + value: function analyze(container) { + var current = this.element, + resources = this.resources, + i, + ii; + + if (current) { + if (!current.type.isAnalyzed) { + current.type.isAnalyzed = true; + current.type.analyze(container, current.value); + } + } + + for (i = 0, ii = resources.length; i < ii; ++i) { + current = resources[i]; + + if ("analyze" in current.type && !current.type.isAnalyzed) { + current.type.isAnalyzed = true; + current.type.analyze(container, current.value); + } + } + }, + writable: true, + enumerable: true, + configurable: true + }, register: { value: function register(registry, name) { var i, diff --git a/dist/commonjs/template-controller.js b/dist/commonjs/template-controller.js index 37272ed7..c6cf679c 100644 --- a/dist/commonjs/template-controller.js +++ b/dist/commonjs/template-controller.js @@ -46,9 +46,16 @@ var TemplateController = (function (ResourceType) { configurable: true } }, { + analyze: { + value: function analyze(container, target) { + configureBehavior(container, this, target); + }, + writable: true, + enumerable: true, + configurable: true + }, load: { value: function load(container, target) { - configureBehavior(container, this, target); return Promise.resolve(this); }, writable: true, diff --git a/dist/es6/attached-behavior.js b/dist/es6/attached-behavior.js index e2439074..da99d5c2 100644 --- a/dist/es6/attached-behavior.js +++ b/dist/es6/attached-behavior.js @@ -16,8 +16,11 @@ export class AttachedBehavior extends ResourceType { } } - load(container, target){ + analyze(container, target){ configureBehavior(container, this, target); + } + + load(container, target){ return Promise.resolve(this); } diff --git a/dist/es6/custom-element.js b/dist/es6/custom-element.js index 183c3883..234df71c 100644 --- a/dist/es6/custom-element.js +++ b/dist/es6/custom-element.js @@ -26,11 +26,7 @@ export class CustomElement extends ResourceType { } } - configure(container, target){ - if(this.configured){ - return; - } - + analyze(container, target){ configureBehavior(container, this, target, valuePropertyName); this.configured = true; @@ -41,8 +37,6 @@ export class CustomElement extends ResourceType { load(container, target, viewStrategy){ var options; - this.configure(container, target); - viewStrategy = viewStrategy || ViewStrategy.getDefault(target); options = { targetShadowDOM:this.targetShadowDOM }; diff --git a/dist/es6/resource-coordinator.js b/dist/es6/resource-coordinator.js index ca28c39e..d1ddd189 100644 --- a/dist/es6/resource-coordinator.js +++ b/dist/es6/resource-coordinator.js @@ -66,6 +66,8 @@ export class ResourceCoordinator { throw new Error(`No element found in module "${moduleImport}".`); } + analysis.analyze(container); + for(i = 0, ii = resources.length; i < ii; ++i){ current = resources[i]; type = current.type; @@ -78,10 +80,7 @@ export class ResourceCoordinator { cache[analysis.id] = analysis; - return Promise.all(loads).then(() => { - analysis.element.type.configure(container, analysis.element.value); - return analysis.element; - }); + return Promise.all(loads).then(() => analysis.element); }); } @@ -91,12 +90,15 @@ export class ResourceCoordinator { finalModules = [], importIds = [], analysis, type; + var container = this.container; + for(i = 0, ii = imports.length; i < ii; ++i){ current = imports[i]; annotation = Origin.get(current); if(!annotation){ analysis = analyzeModule({'default':current}); + analysis.analyze(container); type = (analysis.element || analysis.resources[0]).type; if(resourceManifestUrl){ @@ -162,6 +164,7 @@ export class ResourceCoordinator { } analysis = analyzeModule(imports[i]); + analysis.analyze(container); existing[analysis.id] = analysis; allAnalysis[i] = analysis; resources = analysis.resources; @@ -211,6 +214,28 @@ class ResourceModule { } } + analyze(container){ + var current = this.element, + resources = this.resources, + i, ii; + + if(current){ + if(!current.type.isAnalyzed){ + current.type.isAnalyzed = true; + current.type.analyze(container, current.value); + } + } + + for(i = 0, ii = resources.length; i < ii; ++i){ + current = resources[i]; + + if('analyze' in current.type && !current.type.isAnalyzed){ + current.type.isAnalyzed = true; + current.type.analyze(container, current.value); + } + } + } + register(registry, name){ var i, ii, resources = this.resources; diff --git a/dist/es6/template-controller.js b/dist/es6/template-controller.js index 5fe1d6e0..2e706444 100644 --- a/dist/es6/template-controller.js +++ b/dist/es6/template-controller.js @@ -17,8 +17,11 @@ export class TemplateController extends ResourceType { } } - load(container, target){ + analyze(container, target){ configureBehavior(container, this, target); + } + + load(container, target){ return Promise.resolve(this); } diff --git a/dist/system/attached-behavior.js b/dist/system/attached-behavior.js index ec136ed8..9cd44428 100644 --- a/dist/system/attached-behavior.js +++ b/dist/system/attached-behavior.js @@ -54,9 +54,16 @@ System.register(["aurelia-metadata", "./behavior-instance", "./behaviors", "./ut configurable: true } }, { + analyze: { + value: function analyze(container, target) { + configureBehavior(container, this, target); + }, + writable: true, + enumerable: true, + configurable: true + }, load: { value: function load(container, target) { - configureBehavior(container, this, target); return Promise.resolve(this); }, writable: true, diff --git a/dist/system/custom-element.js b/dist/system/custom-element.js index 715bc5bd..6ce88a80 100644 --- a/dist/system/custom-element.js +++ b/dist/system/custom-element.js @@ -70,12 +70,8 @@ System.register(["aurelia-metadata", "./behavior-instance", "./behaviors", "./co configurable: true } }, { - configure: { - value: function configure(container, target) { - if (this.configured) { - return; - } - + analyze: { + value: function analyze(container, target) { configureBehavior(container, this, target, valuePropertyName); this.configured = true; @@ -91,8 +87,6 @@ System.register(["aurelia-metadata", "./behavior-instance", "./behaviors", "./co var _this = this; var options; - this.configure(container, target); - viewStrategy = viewStrategy || ViewStrategy.getDefault(target); options = { targetShadowDOM: this.targetShadowDOM }; diff --git a/dist/system/resource-coordinator.js b/dist/system/resource-coordinator.js index 1a5118a6..204af634 100644 --- a/dist/system/resource-coordinator.js +++ b/dist/system/resource-coordinator.js @@ -183,6 +183,8 @@ System.register(["aurelia-loader", "aurelia-path", "aurelia-dependency-injection throw new Error("No element found in module \"" + moduleImport + "\"."); } + analysis.analyze(container); + for (i = 0, ii = resources.length; i < ii; ++i) { current = resources[i]; type = current.type; @@ -196,7 +198,6 @@ System.register(["aurelia-loader", "aurelia-path", "aurelia-dependency-injection cache[analysis.id] = analysis; return Promise.all(loads).then(function () { - analysis.element.type.configure(container, analysis.element.value); return analysis.element; }); }); @@ -218,12 +219,15 @@ System.register(["aurelia-loader", "aurelia-path", "aurelia-dependency-injection analysis, type; + var container = this.container; + for (i = 0, ii = imports.length; i < ii; ++i) { current = imports[i]; annotation = Origin.get(current); if (!annotation) { analysis = analyzeModule({ "default": current }); + analysis.analyze(container); type = (analysis.element || analysis.resources[0]).type; if (resourceManifestUrl) { @@ -307,6 +311,7 @@ System.register(["aurelia-loader", "aurelia-path", "aurelia-dependency-injection } analysis = analyzeModule(imports[i]); + analysis.analyze(container); existing[analysis.id] = analysis; allAnalysis[i] = analysis; resources = analysis.resources; @@ -367,6 +372,33 @@ System.register(["aurelia-loader", "aurelia-path", "aurelia-dependency-injection } _prototypeProperties(ResourceModule, null, { + analyze: { + value: function analyze(container) { + var current = this.element, + resources = this.resources, + i, + ii; + + if (current) { + if (!current.type.isAnalyzed) { + current.type.isAnalyzed = true; + current.type.analyze(container, current.value); + } + } + + for (i = 0, ii = resources.length; i < ii; ++i) { + current = resources[i]; + + if ("analyze" in current.type && !current.type.isAnalyzed) { + current.type.isAnalyzed = true; + current.type.analyze(container, current.value); + } + } + }, + writable: true, + enumerable: true, + configurable: true + }, register: { value: function register(registry, name) { var i, diff --git a/dist/system/template-controller.js b/dist/system/template-controller.js index cb0f6307..0068ec21 100644 --- a/dist/system/template-controller.js +++ b/dist/system/template-controller.js @@ -55,9 +55,16 @@ System.register(["aurelia-metadata", "./behavior-instance", "./behaviors", "./ut configurable: true } }, { + analyze: { + value: function analyze(container, target) { + configureBehavior(container, this, target); + }, + writable: true, + enumerable: true, + configurable: true + }, load: { value: function load(container, target) { - configureBehavior(container, this, target); return Promise.resolve(this); }, writable: true, diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index fb6ad13b..3e1aedca 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,11 @@ +### 0.8.5 (2015-01-25) + + +#### Bug Fixes + +* **resources:** enable early name analysis of resources ([331fcfd1](http://github.com/aurelia/templating/commit/331fcfd1341acab1c0cc65a103c3951cd047ca6b)) + + ### 0.8.4 (2015-01-24) diff --git a/package.json b/package.json index 9b350f0d..bc2dcf86 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating", - "version": "0.8.4", + "version": "0.8.5", "description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.", "keywords": [ "aurelia",