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,12 +206,14 @@ export default function visitComponent(
componentInitProperties.push(`data: ${initialPropString}`);
}
block.builders.update.addBlock(deindent`
var ${name}_changes = {};
${updates.join('\n')}
${name}._set( ${name}_changes );
${bindings.length && `${name_updating} = {};`}
`);
if (updates.length) {
block.builders.update.addBlock(deindent`
var ${name}_changes = {};
${updates.join('\n')}
${name}._set( ${name}_changes );
${bindings.length && `${name_updating} = {};`}
`);
}
}
const expression = node.name === ':Self'

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