diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bd7fd0..9bb10a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +0.2.1 +- Fixed issue analyzing slots. +- Fixed bug mounting components. + 0.2.0 - Added commonjs to the list of output formats. - Added new badges to the README. diff --git a/package-lock.json b/package-lock.json index bfda097..bdde1b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "trebor", - "version": "0.2.0", + "version": "0.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5e286d6..ef15d9f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "trebor", - "version": "0.2.0", + "version": "0.2.1", "description": "A node js module to make standalone web components.", "main": "./build/index.js", "bin": { @@ -59,7 +59,13 @@ "webpack": "^4.16.5", "webpack-cli": "^3.1.0" }, - "keywords": [], + "keywords": [ + "single-file-component", + "standalone-components", + "no-framework", + "cli", + "web-components" + ], "author": "InDIOS", "repository": { "type": "git", diff --git a/src/generators/components.ts b/src/generators/components.ts index e5c4325..da3e139 100644 --- a/src/generators/components.ts +++ b/src/generators/components.ts @@ -142,7 +142,7 @@ export function genComponent(node: NodeElement, areas: BlockAreas, scope: string }`); } }); - areas.unmount.push(`${variable}.$mount(_$frag, ${anchor});`); + areas.unmount.push(`${variable}.$mount(${root || '_$frag'}, ${anchor});`); if (varName === 'component') { let updateVar = `update${capitalize(variable)}`; areas.update.push(`let ${updateVar} = ${setComponent}(${isIsAttrExp ? [scope, ...params].join(', ') : ''}); diff --git a/src/utilities/classes.ts b/src/utilities/classes.ts index 8222806..7ada1c5 100644 --- a/src/utilities/classes.ts +++ b/src/utilities/classes.ts @@ -162,7 +162,8 @@ export class NodeElement { } hasExpression(): boolean { - return this.isUnknownElement || this.attributes.some(a => /^[$@:#]/.test(a.name)) || + return this.isUnknownElement || this.tagName === 'slot' || + this.attributes.some(a => /^[$@:#]/.test(a.name)) || /\{\{\s*((?!\}\})(.|\n))*\}\}/.test(this.textContent) || this.childNodes.some(c => c.hasExpression()); }