Merge branch 'test-gh-1743' into gh-1743

pull/1822/head
pk 6 years ago
commit 4d49839cce

@ -1,5 +1,9 @@
# Svelte changelog
## 2.15.1
* Don't throw missing store error when store is declared in component ([#1828](https://github.com/sveltejs/svelte/issues/1828))
## 2.15.0
* Event modifiers ([#1088](https://github.com/sveltejs/svelte/issues/1088))

2
package-lock.json generated

@ -1,6 +1,6 @@
{
"name": "svelte",
"version": "2.14.2",
"version": "2.15.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -1,6 +1,6 @@
{
"name": "svelte",
"version": "2.15.0",
"version": "2.15.1",
"description": "The magical disappearing UI framework",
"main": "compiler/svelte.js",
"bin": {

@ -152,7 +152,7 @@ export default function dom(
if (!options || (!options.target && !options.root)) {
throw new Error("'target' is a required option");
}`}
${storeProps.length > 0 && deindent`
${storeProps.length > 0 && !templateProperties.store && deindent`
if (!options.store) {
throw new Error("${debugName} references store properties, but no store was provided");
}`}

@ -115,7 +115,7 @@ export default function ssr(
${templateProperties.store && `options.store = %store();`}
__result.addComponent(${name});
${options.dev && storeProps.length > 0 && deindent`
${options.dev && storeProps.length > 0 && !templateProperties.store && deindent`
if (!options.store) {
throw new Error("${debugName} references store properties, but no store was provided");
}

@ -48,6 +48,8 @@ export function tryToReadFile(file) {
export const virtualConsole = new jsdom.VirtualConsole();
const { window } = new jsdom.JSDOM('<main></main>', {virtualConsole});
global.document = window.document;
global.getComputedStyle = window.getComputedStyle;
global.navigator = {userAgent: 'fake'};
export function env() {
window._svelteTransitionManager = null;

@ -0,0 +1,5 @@
export default {
compileOptions: {
dev: true
}
};

@ -0,0 +1,11 @@
<p>{$foo}</p>
<script>
import { Store } from '../../../../store.js';
const store = new Store({ foo : "foo" });
export default {
store : () => store,
};
</script>

@ -0,0 +1,8 @@
export default {
'skip-ssr': true,
test(assert, component, target) {
assert.ok(component.onstateRanBeforeOncreate);
assert.ok(!component.onupdateRanBeforeOncreate);
}
};

@ -0,0 +1,17 @@
<div bind:offsetWidth=width></div>
<script>
export default {
onstate() {
this.onstateRan = true;
},
onupdate() {
this.onupdateRan = true;
},
oncreate() {
this.onstateRanBeforeOncreate = this.onstateRan;
this.onupdateRanBeforeOncreate = this.onupdateRan;
}
};
</script>
Loading…
Cancel
Save