diff --git a/bower.json b/bower.json index a3d76d63..0066872e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating", - "version": "1.10.0", + "version": "1.10.1", "description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.", "keywords": [ "aurelia", diff --git a/dist/amd/aurelia-templating.js b/dist/amd/aurelia-templating.js index 2d38fe26..d033d8a9 100644 --- a/dist/amd/aurelia-templating.js +++ b/dist/amd/aurelia-templating.js @@ -772,19 +772,22 @@ define(['exports', 'aurelia-logging', 'aurelia-metadata', 'aurelia-pal', 'aureli if (typeof dep === 'function') { resource = viewResources.autoRegister(container, dep); + if (resource.elementName !== null) { + elDeps.push(resource); + } } else if (dep && (typeof dep === 'undefined' ? 'undefined' : _typeof(dep)) === 'object') { for (var _key2 in dep) { var exported = dep[_key2]; if (typeof exported === 'function') { resource = viewResources.autoRegister(container, exported); + if (resource.elementName !== null) { + elDeps.push(resource); + } } } } else { throw new Error('dependency neither function nor object. Received: "' + (typeof dep === 'undefined' ? 'undefined' : _typeof(dep)) + '"'); } - if (resource.elementName !== null) { - elDeps.push(resource); - } } return Promise.all(elDeps.map(function (el) { @@ -3011,8 +3014,9 @@ define(['exports', 'aurelia-logging', 'aurelia-metadata', 'aurelia-pal', 'aureli type = resources.getElement(node.getAttribute('as-element') || tagName); if (tagName === 'let' && !type && bindingLanguage.createLetExpressions !== defaultLetHandler) { + expressions = bindingLanguage.createLetExpressions(resources, node); auTargetID = makeIntoInstructionTarget(node); - instructions[auTargetID] = TargetInstruction.letElement(bindingLanguage.createLetExpressions(resources, node)); + instructions[auTargetID] = TargetInstruction.letElement(expressions); return node.nextSibling; } if (type) { diff --git a/dist/aurelia-templating.js b/dist/aurelia-templating.js index 1ea6633c..7fb1986a 100644 --- a/dist/aurelia-templating.js +++ b/dist/aurelia-templating.js @@ -1047,20 +1047,23 @@ export class StaticViewStrategy { if (typeof dep === 'function') { // dependencies: [class1, class2, import('module').then(m => m.class3)] resource = viewResources.autoRegister(container, dep); + if (resource.elementName !== null) { + elDeps.push(resource); + } } else if (dep && typeof dep === 'object') { // dependencies: [import('module1'), import('module2')] for (let key in dep) { let exported = dep[key]; if (typeof exported === 'function') { resource = viewResources.autoRegister(container, exported); + if (resource.elementName !== null) { + elDeps.push(resource); + } } } } else { throw new Error(`dependency neither function nor object. Received: "${typeof dep}"`); } - if (resource.elementName !== null) { - elDeps.push(resource); - } } // only load custom element as first step. return Promise.all(elDeps.map(el => el.load(container, el.target))).then(() => { @@ -3901,13 +3904,9 @@ export class ViewCompiler { // and the binding language has an implementation for it // This is an backward compat move if (tagName === 'let' && !type && bindingLanguage.createLetExpressions !== defaultLetHandler) { + expressions = bindingLanguage.createLetExpressions(resources, node); auTargetID = makeIntoInstructionTarget(node); - instructions[auTargetID] = TargetInstruction.letElement( - bindingLanguage.createLetExpressions( - resources, - node - ) - ); + instructions[auTargetID] = TargetInstruction.letElement(expressions); return node.nextSibling; } if (type) { diff --git a/dist/commonjs/aurelia-templating.js b/dist/commonjs/aurelia-templating.js index 9c09c04e..7e6ef5bc 100644 --- a/dist/commonjs/aurelia-templating.js +++ b/dist/commonjs/aurelia-templating.js @@ -753,19 +753,22 @@ var StaticViewStrategy = exports.StaticViewStrategy = (_dec6 = viewStrategy(), _ if (typeof dep === 'function') { resource = viewResources.autoRegister(container, dep); + if (resource.elementName !== null) { + elDeps.push(resource); + } } else if (dep && (typeof dep === 'undefined' ? 'undefined' : _typeof(dep)) === 'object') { for (var _key2 in dep) { var exported = dep[_key2]; if (typeof exported === 'function') { resource = viewResources.autoRegister(container, exported); + if (resource.elementName !== null) { + elDeps.push(resource); + } } } } else { throw new Error('dependency neither function nor object. Received: "' + (typeof dep === 'undefined' ? 'undefined' : _typeof(dep)) + '"'); } - if (resource.elementName !== null) { - elDeps.push(resource); - } } return Promise.all(elDeps.map(function (el) { @@ -2992,8 +2995,9 @@ var ViewCompiler = exports.ViewCompiler = (_dec7 = (0, _aureliaDependencyInjecti type = resources.getElement(node.getAttribute('as-element') || tagName); if (tagName === 'let' && !type && bindingLanguage.createLetExpressions !== defaultLetHandler) { + expressions = bindingLanguage.createLetExpressions(resources, node); auTargetID = makeIntoInstructionTarget(node); - instructions[auTargetID] = TargetInstruction.letElement(bindingLanguage.createLetExpressions(resources, node)); + instructions[auTargetID] = TargetInstruction.letElement(expressions); return node.nextSibling; } if (type) { diff --git a/dist/es2015/aurelia-templating.js b/dist/es2015/aurelia-templating.js index 0680dba4..9e09f802 100644 --- a/dist/es2015/aurelia-templating.js +++ b/dist/es2015/aurelia-templating.js @@ -613,19 +613,22 @@ export let StaticViewStrategy = (_dec6 = viewStrategy(), _dec6(_class7 = class S for (let dep of dependencies) { if (typeof dep === 'function') { resource = viewResources.autoRegister(container, dep); + if (resource.elementName !== null) { + elDeps.push(resource); + } } else if (dep && typeof dep === 'object') { for (let key in dep) { let exported = dep[key]; if (typeof exported === 'function') { resource = viewResources.autoRegister(container, exported); + if (resource.elementName !== null) { + elDeps.push(resource); + } } } } else { throw new Error(`dependency neither function nor object. Received: "${typeof dep}"`); } - if (resource.elementName !== null) { - elDeps.push(resource); - } } return Promise.all(elDeps.map(el => el.load(container, el.target))).then(() => { @@ -2747,8 +2750,9 @@ export let ViewCompiler = (_dec7 = inject(BindingLanguage, ViewResources), _dec7 type = resources.getElement(node.getAttribute('as-element') || tagName); if (tagName === 'let' && !type && bindingLanguage.createLetExpressions !== defaultLetHandler) { + expressions = bindingLanguage.createLetExpressions(resources, node); auTargetID = makeIntoInstructionTarget(node); - instructions[auTargetID] = TargetInstruction.letElement(bindingLanguage.createLetExpressions(resources, node)); + instructions[auTargetID] = TargetInstruction.letElement(expressions); return node.nextSibling; } if (type) { diff --git a/dist/native-modules/aurelia-templating.js b/dist/native-modules/aurelia-templating.js index 1120f427..3b3d55c1 100644 --- a/dist/native-modules/aurelia-templating.js +++ b/dist/native-modules/aurelia-templating.js @@ -714,19 +714,22 @@ export var StaticViewStrategy = (_dec6 = viewStrategy(), _dec6(_class7 = functio if (typeof dep === 'function') { resource = viewResources.autoRegister(container, dep); + if (resource.elementName !== null) { + elDeps.push(resource); + } } else if (dep && (typeof dep === 'undefined' ? 'undefined' : _typeof(dep)) === 'object') { for (var _key2 in dep) { var exported = dep[_key2]; if (typeof exported === 'function') { resource = viewResources.autoRegister(container, exported); + if (resource.elementName !== null) { + elDeps.push(resource); + } } } } else { throw new Error('dependency neither function nor object. Received: "' + (typeof dep === 'undefined' ? 'undefined' : _typeof(dep)) + '"'); } - if (resource.elementName !== null) { - elDeps.push(resource); - } } return Promise.all(elDeps.map(function (el) { @@ -2952,8 +2955,9 @@ export var ViewCompiler = (_dec7 = inject(BindingLanguage, ViewResources), _dec7 type = resources.getElement(node.getAttribute('as-element') || tagName); if (tagName === 'let' && !type && bindingLanguage.createLetExpressions !== defaultLetHandler) { + expressions = bindingLanguage.createLetExpressions(resources, node); auTargetID = makeIntoInstructionTarget(node); - instructions[auTargetID] = TargetInstruction.letElement(bindingLanguage.createLetExpressions(resources, node)); + instructions[auTargetID] = TargetInstruction.letElement(expressions); return node.nextSibling; } if (type) { diff --git a/dist/system/aurelia-templating.js b/dist/system/aurelia-templating.js index ca3fbd28..81267144 100644 --- a/dist/system/aurelia-templating.js +++ b/dist/system/aurelia-templating.js @@ -1510,19 +1510,22 @@ System.register(['aurelia-logging', 'aurelia-metadata', 'aurelia-pal', 'aurelia- if (typeof dep === 'function') { resource = viewResources.autoRegister(container, dep); + if (resource.elementName !== null) { + elDeps.push(resource); + } } else if (dep && (typeof dep === 'undefined' ? 'undefined' : _typeof(dep)) === 'object') { for (var _key2 in dep) { var exported = dep[_key2]; if (typeof exported === 'function') { resource = viewResources.autoRegister(container, exported); + if (resource.elementName !== null) { + elDeps.push(resource); + } } } } else { throw new Error('dependency neither function nor object. Received: "' + (typeof dep === 'undefined' ? 'undefined' : _typeof(dep)) + '"'); } - if (resource.elementName !== null) { - elDeps.push(resource); - } } return Promise.all(elDeps.map(function (el) { @@ -3431,8 +3434,9 @@ System.register(['aurelia-logging', 'aurelia-metadata', 'aurelia-pal', 'aurelia- type = resources.getElement(node.getAttribute('as-element') || tagName); if (tagName === 'let' && !type && bindingLanguage.createLetExpressions !== defaultLetHandler) { + expressions = bindingLanguage.createLetExpressions(resources, node); auTargetID = makeIntoInstructionTarget(node); - instructions[auTargetID] = TargetInstruction.letElement(bindingLanguage.createLetExpressions(resources, node)); + instructions[auTargetID] = TargetInstruction.letElement(expressions); return node.nextSibling; } if (type) { diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 83d4b9da..d4790ed4 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,17 @@ + +## [1.10.1](https://github.com/aurelia/templating/compare/1.10.0...1.10.1) (2018-10-30) + + +### Bug Fixes + +* **doc:** fix html5 syntax ([8452a66](https://github.com/aurelia/templating/commit/8452a66)), closes [/github.com/aurelia/templating/pull/647#issuecomment-427989601](https://github.com//github.com/aurelia/templating/pull/647/issues/issuecomment-427989601) +* **Let:** mark as target after creating instrutions ([93fa9cc](https://github.com/aurelia/templating/commit/93fa9cc)) +* **Let:** properly create instruction Id ([ac3cb2b](https://github.com/aurelia/templating/commit/ac3cb2b)) +* **static-view-strategy:** correctly handles invalid resources ([4149e73](https://github.com/aurelia/templating/commit/4149e73)) +* **static-view-strategy:** correctly loads multiple custom elements in single file ([c0e6204](https://github.com/aurelia/templating/commit/c0e6204)) + + + # [1.10.0](https://github.com/aurelia/templating/compare/1.9.0...1.10.0) (2018-09-30) diff --git a/package.json b/package.json index bcefea54..816c6ec7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating", - "version": "1.10.0", + "version": "1.10.1", "description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.", "keywords": [ "aurelia",