diff --git a/CHANGELOG.md b/CHANGELOG.md index 43d0cacd5202..017a2219b8cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Svelte changelog +## 1.17.2 + +* Replace bad characters when creating variable names based on element names ([#516](https://github.com/sveltejs/svelte/issues/516)) + +## 1.17.1 + +* Fixes for static each-else and yield blocks ([#509](https://github.com/sveltejs/svelte/issues/509)), ([#514](https://github.com/sveltejs/svelte/issues/514)) +* Code generation tweaks ([#504](https://github.com/sveltejs/svelte/issues/504)), ([#507](https://github.com/sveltejs/svelte/issues/507)) + ## 1.17.0 * Add `currentTime`, `duration` and `paused` bindings for media elements ([#406](https://github.com/sveltejs/svelte/issues/406)) @@ -43,7 +52,7 @@ * Add `bind:online` to window ([#404](https://github.com/sveltejs/svelte/issues/404)) * In dev mode, throw if read-only properties are set ([#404](https://github.com/sveltejs/svelte/issues/404)) * Prevent conflicts with component name ([#464](https://github.com/sveltejs/svelte/pull/464)) -* Ensure event handler names are deconflicted ([#466https://github.com/sveltejs/svelte/issues/466 +* Ensure event handler names are deconflicted ([#466](https://github.com/sveltejs/svelte/issues/466)) ## 1.13.7 @@ -279,7 +288,7 @@ ## 1.2.4 -* SSR compiler: Implement `{{{tripes}}}` ([#197](https://github.com/sveltejs/svelte/issues/197)) +* SSR compiler: Implement `{{{triples}}}` ([#197](https://github.com/sveltejs/svelte/issues/197)) * SSR compiler: Escape HTML in tags ([#197](https://github.com/sveltejs/svelte/issues/197)) ## 1.2.3 diff --git a/package.json b/package.json index 85a30aad2141..3e89b6e2fa7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "svelte", - "version": "1.17.0", + "version": "1.17.2", "description": "The magical disappearing UI framework", "main": "compiler/svelte.js", "files": [ diff --git a/src/generators/dom/visitors/Component/Component.js b/src/generators/dom/visitors/Component/Component.js index 6430c4f07c18..b2768d6cf12a 100644 --- a/src/generators/dom/visitors/Component/Component.js +++ b/src/generators/dom/visitors/Component/Component.js @@ -111,9 +111,11 @@ export default function visitComponent ( generator, block, state, node ) { `var ${yieldFragment} = ${childBlock.name}( ${params}, ${block.component} );` ); - block.builders.update.addLine( - `${yieldFragment}.update( changed, ${params} );` - ); + if ( childBlock.hasUpdateMethod ) { + block.builders.update.addLine( + `${yieldFragment}.update( changed, ${params} );` + ); + } componentInitProperties.push( `_yield: ${yieldFragment}`); } @@ -181,4 +183,4 @@ export default function visitComponent ( generator, block, state, node ) { block.builders.create.addBlock( local.create ); if ( !local.update.isEmpty() ) block.builders.update.addBlock( local.update ); -} \ No newline at end of file +} diff --git a/src/generators/dom/visitors/Element/Element.js b/src/generators/dom/visitors/Element/Element.js index 001c8a52e202..5ce0f6ba5b63 100644 --- a/src/generators/dom/visitors/Element/Element.js +++ b/src/generators/dom/visitors/Element/Element.js @@ -49,20 +49,19 @@ export default function visitElement ( generator, block, state, node ) { block.builders.create.addLine( `${generator.helper( 'setAttribute' )}( ${name}, '${generator.cssId}', '' );` ); } - let selectValueAttribute; - - node.attributes - .sort( ( a, b ) => order[ a.type ] - order[ b.type ] ) - .forEach( attribute => { - // value attributes are an annoying special case — it must be handled + // *after* its children have been updated + visitAttributes(); + } // special case – bound