Merge pull request #857 from sveltejs/static-components

Skip updates for components with no dynamic props/bindings
pull/861/head
Rich Harris 7 years ago committed by GitHub
commit 225f59a3f5

@ -206,6 +206,7 @@ export default function visitComponent(
componentInitProperties.push(`data: ${initialPropString}`); componentInitProperties.push(`data: ${initialPropString}`);
} }
if (updates.length) {
block.builders.update.addBlock(deindent` block.builders.update.addBlock(deindent`
var ${name}_changes = {}; var ${name}_changes = {};
${updates.join('\n')} ${updates.join('\n')}
@ -213,6 +214,7 @@ export default function visitComponent(
${bindings.length && `${name_updating} = {};`} ${bindings.length && `${name_updating} = {};`}
`); `);
} }
}
const expression = node.name === ':Self' const expression = node.name === ':Self'
? generator.name ? generator.name

@ -0,0 +1,9 @@
<Nested foo='bar'/>
<script>
export default {
components: {
Nested: window.Nested
}
};
</script>
Loading…
Cancel
Save