Merge branch 'master' into mrkishi-spread

pull/1289/head
Rich-Harris 7 years ago
commit 3f32be8c04

@ -1,5 +1,9 @@
# Svelte changelog
## 1.58.4
* Fix initial state regression ([#1283](https://github.com/sveltejs/svelte/pull/1283))
## 1.58.3
* Actions run in the context of the component ([#1279](https://github.com/sveltejs/svelte/pull/1279))

@ -1,6 +1,6 @@
{
"name": "svelte",
"version": "1.58.3",
"version": "1.58.4",
"description": "The magical disappearing UI framework",
"main": "compiler/svelte.js",
"files": [

@ -202,7 +202,7 @@ export default function dom(
@init(this, options);
${templateProperties.store && `this.store = %store();`}
${generator.usesRefs && `this.refs = {};`}
this._state = @assign(${initialState.join(', ')});
this._state = ${initialState.reduce((state, piece) => `@assign(${state}, ${piece})`)};
${storeProps.length > 0 && `this.store._add(this, [${storeProps.map(prop => `"${prop.slice(1)}"`)}]);`}
${generator.metaBindings}
${computations.length && `this._recompute({ ${Array.from(computationDeps).map(dep => `${dep}: 1`).join(', ')} }, this._state);`}

@ -0,0 +1,7 @@
export default {
data: { bar: 'bar' },
html: `
"foo"
"bar"
`,
};

@ -0,0 +1,10 @@
{{JSON.stringify(foo)}}
{{JSON.stringify(bar)}}
<script>
export default {
data() {
return { foo: 'foo' };
}
};
</script>
Loading…
Cancel
Save