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

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