Merge branch 'master' into pr/3747

pull/3747/head
Conduitry 6 years ago
commit e5717fb062

@ -7,9 +7,12 @@
* Allow exiting a reactive block early with `break $` ([#2828](https://github.com/sveltejs/svelte/issues/2828))
* Check attributes have changed before setting them to avoid image flicker ([#3579](https://github.com/sveltejs/svelte/pull/3579))
* Fix generating malformed code for `{@debug}` tags with no dependencies ([#3588](https://github.com/sveltejs/svelte/issue/3588))
* Fix generated code in specific case involving compound ifs and child components ([#3595](https://github.com/sveltejs/svelte/issue/3595))
* Fix `bind:this` binding to a store ([#3591](https://github.com/sveltejs/svelte/issue/3591))
* Use safer `HTMLElement` check before extending class ([#3608](https://github.com/sveltejs/svelte/issue/3608))
* Add `location` as a known global ([#3619](https://github.com/sveltejs/svelte/pull/3619))
* Support `{#await}` with `{:catch}` but no `{:then}` ([#3623](https://github.com/sveltejs/svelte/issues/3623))
* Clean up dead code emitted for `<slot/>`s ([#3631](https://github.com/sveltejs/svelte/issues/3631))
* Fix tracking of dependencies of compound assignments in reactive statements ([#3634](https://github.com/sveltejs/svelte/issues/3634))
* Flush changes in newly attached block when using `{#await}` ([#3660](https://github.com/sveltejs/svelte/issues/3660))
* Throw exception immediately when calling `createEventDispatcher()` after component instantiation ([#3667](https://github.com/sveltejs/svelte/pull/3667))

53
package-lock.json generated

@ -1,6 +1,6 @@
{
"name": "svelte",
"version": "3.12.1",
"version": "3.13.0-alpha.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -167,9 +167,9 @@
"dev": true
},
"acorn": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz",
"integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==",
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz",
"integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==",
"dev": true
},
"acorn-globals": {
@ -490,14 +490,14 @@
"dev": true
},
"code-red": {
"version": "0.0.17",
"resolved": "https://registry.npmjs.org/code-red/-/code-red-0.0.17.tgz",
"integrity": "sha512-RJJ48sXYOqyd0J4QelF4dRdYb+4DaLV/jHs4mNoxOdLroUGB840cMc9pMtEAbGKjFFzoTKREypFzqphBD8knMg==",
"version": "0.0.18",
"resolved": "https://registry.npmjs.org/code-red/-/code-red-0.0.18.tgz",
"integrity": "sha512-g7W6RwRqBbQTtMaUqrNWDyyl2GK0Uulk/uZPzGdgTXpOGX/LA8bW67EKQLdQgpYfd6APhZVwoX2lrL7mnJOWkA==",
"dev": true,
"requires": {
"acorn": "^7.0.0",
"is-reference": "^1.1.3",
"periscopic": "^1.0.1",
"acorn": "^7.1.0",
"is-reference": "^1.1.4",
"periscopic": "^1.0.2",
"sourcemap-codec": "^1.4.6"
}
},
@ -1147,14 +1147,6 @@
"acorn": "^7.0.0",
"acorn-jsx": "^5.0.2",
"eslint-visitor-keys": "^1.1.0"
},
"dependencies": {
"acorn": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz",
"integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==",
"dev": true
}
}
},
"esprima": {
@ -1768,9 +1760,9 @@
"dev": true
},
"is-reference": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.3.tgz",
"integrity": "sha512-W1iHHv/oyBb2pPxkBxtaewxa1BC58Pn5J0hogyCdefwUIvb6R+TGbAcIa4qPNYLqLhb3EnOgUf2MQkkF76BcKw==",
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz",
"integrity": "sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw==",
"dev": true,
"requires": {
"@types/estree": "0.0.39"
@ -2727,17 +2719,6 @@
"dev": true,
"requires": {
"is-reference": "^1.1.4"
},
"dependencies": {
"is-reference": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz",
"integrity": "sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw==",
"dev": true,
"requires": {
"@types/estree": "0.0.39"
}
}
}
},
"pify": {
@ -3646,14 +3627,6 @@
"@types/istanbul-lib-coverage": "^2.0.1",
"convert-source-map": "^1.6.0",
"source-map": "^0.7.3"
},
"dependencies": {
"source-map": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
"integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
"dev": true
}
}
},
"validate-npm-package-license": {

@ -1,6 +1,6 @@
{
"name": "svelte",
"version": "3.13.0-alpha.0",
"version": "3.13.0-alpha.1",
"description": "Cybernetically enhanced web apps",
"module": "index.mjs",
"main": "index",
@ -60,17 +60,17 @@
"@types/node": "^8.10.53",
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^2.1.0",
"acorn": "^7.0.0",
"acorn": "^7.1.0",
"agadoo": "^1.1.0",
"c8": "^5.0.1",
"code-red": "0.0.17",
"code-red": "0.0.18",
"codecov": "^3.5.0",
"css-tree": "1.0.0-alpha22",
"eslint": "^6.3.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-svelte3": "^2.7.3",
"estree-walker": "^0.8.1",
"is-reference": "^1.1.3",
"is-reference": "^1.1.4",
"jsdom": "^15.1.1",
"kleur": "^3.0.3",
"locate-character": "^2.0.5",

@ -1019,8 +1019,12 @@ Unlike client-side components, server-side components don't have a lifespan afte
A server-side component exposes a `render` method that can be called with optional props. It returns an object with `head`, `html`, and `css` properties, where `head` contains the contents of any `<svelte:head>` elements encountered.
You can import a Svelte component directly into Node using [`svelte/register`](docs#svelte_register).
```js
const App = require('./App.svelte');
require('svelte/register');
const App = require('./App.svelte').default;
const { head, html, css } = App.render({
answer: 42

@ -55,6 +55,7 @@
<a target="_blank" rel="noopener" href="https://deck.nl"><img src="organisations/deck.svg" alt="Deck logo" loading="lazy"></a>
<a target="_blank" rel="noopener" href="https://dextra.com.br/pt/"><img src="organisations/dextra.png" alt="Dextra logo" loading="lazy"></a>
<a target="_blank" rel="noopener" href="https://www.entriwise.com/"><img src="organisations/entriwise.png" alt="Entriwise logo" loading="lazy"></a>
<a target="_blank" rel="noopener" href="https://www.entur.org/about-entur/" style="background-color: rgb(25, 25, 84);"><img src="organisations/entur.svg" alt="Entur logo" loading="lazy"></a>
<a target="_blank" rel="noopener" href="https://from-now-on.com"><img src="organisations/from-now-on.png" alt="From-Now-On logo" loading="lazy"></a>
<a target="_blank" rel="noopener" href="https://fusioncharts.com"><img src="organisations/fusioncharts.svg" alt="FusionCharts logo" loading="lazy"></a>
<a target="_blank" rel="noopener" href="https://godaddy.com"><img src="organisations/godaddy.svg" alt="GoDaddy logo" loading="lazy"></a>

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="523" height="158"><rect id="backgroundrect" width="100%" height="100%" x="0" y="0" fill="none" stroke="none"/><style>.st0{fill:#fff}</style><g class="currentLayer"><path class="st0" d="M21.1 18.7v27.6h53.3V65H21.1v26.7h60.1v18.7H0V0h81.2v18.7H21.1z" id="svg_1"/><path d="M195.9 156.4H0v-18.7h195.9v18.7z" id="svg_2" fill="#ff5959"/><path class="st0" d="M193.7 110.2l-72.4-65.5v65.5h-21.1V0h2.3l72.4 66.7V0H196v110.2h-2.3z" id="svg_3"/><path class="st0" d="M299.8 64.9h-31.5v91.5h-21.1V64.9h-31.5V46.2h84.2v18.7z" id="svg_4"/><path class="st0" d="M363.1 158.4c-7.1 0-13.6-1.1-19.4-3.3-5.8-2.2-10.8-5.3-14.9-9.3-4.1-4-7.3-8.9-9.6-14.6-2.3-5.7-3.4-12.1-3.4-19.1V46.3h21.1V112c0 5.5.9 10.1 2.7 13.7 1.8 3.6 4 6.5 6.7 8.6 2.7 2.1 5.5 3.6 8.6 4.4 3.1.8 5.8 1.2 8.2 1.2 2.4 0 5.1-.4 8.2-1.2 3.1-.8 5.9-2.3 8.6-4.4 2.7-2.1 4.9-5 6.7-8.6 1.8-3.6 2.7-8.2 2.7-13.7V46.2h21.1V112c0 7-1.1 13.4-3.3 19.1-2.2 5.7-5.4 10.6-9.5 14.6s-9.1 7.1-14.9 9.3c-5.8 2.3-12.4 3.4-19.6 3.4z" id="svg_5"/><path class="st0" d="M451.2 121.4v35.1h-21.1V46.2h50.1c5.6 0 10.8.9 15.5 2.8 4.7 1.9 8.7 4.5 12 7.8 3.3 3.4 5.9 7.4 7.8 12 1.9 4.7 2.8 9.8 2.8 15.3 0 4.1-.6 8.1-1.7 12-1.1 3.9-2.6 7.4-4.6 10.5-2 3.1-4.4 5.8-7.2 8.1-2.9 2.3-6 3.8-9.4 4.7l27.4 37h-25.1l-25.5-35.1h-21zm0-18.4h24c4.4 0 8-.6 10.9-1.7 2.9-1.1 5.1-2.6 6.8-4.4 1.7-1.8 2.8-3.8 3.4-6.1.6-2.3.9-4.5.9-6.9 0-2.7-.4-5.2-1.3-7.5s-2.2-4.3-3.9-6c-1.8-1.7-4-3.1-6.8-4.1-2.8-1-6.1-1.5-10-1.5h-24V103z" id="svg_6"/></g></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -569,6 +569,7 @@ export default class Component {
this.add_var({
name,
global: true,
hoistable: true
});
}
});
@ -661,6 +662,7 @@ export default class Component {
this.add_var({
name,
global: true,
hoistable: true
});
}
});
@ -764,7 +766,7 @@ export default class Component {
}
if (name[0] === '$' && name[1] !== '$') {
return x`${name.slice(1)}.set(${name})`;
return x`${name.slice(1)}.set(${value || name})`;
}
if (

@ -3,7 +3,7 @@ import { walk } from 'estree-walker';
import is_reference from 'is-reference';
import flatten_reference from '../../utils/flatten_reference';
import { create_scopes, Scope, extract_names } from '../../utils/scope';
import { globals, sanitize } from '../../../utils/names';
import { sanitize } from '../../../utils/names';
import Wrapper from '../../render_dom/wrappers/shared/Wrapper';
import TemplateScope from './TemplateScope';
import get_object from '../../utils/get_object';
@ -75,8 +75,6 @@ export default class Expression {
if (scope.has(name)) return;
if (globals.has(name) && !(component.var_lookup.has(name) || template_scope.names.has(name))) return;
if (name[0] === '$' && template_scope.names.has(name.slice(1))) {
component.error(node, {
code: `contextual-store`,
@ -202,7 +200,6 @@ export default class Expression {
const { name } = flatten_reference(node);
if (scope.has(name)) return;
if (globals.has(name) && !(component.var_lookup.has(name) || template_scope.names.has(name))) return;
if (function_expression) {
if (template_scope.names.has(name)) {

@ -146,11 +146,13 @@ export default class Block {
if (!wrapper.var) continue;
let suffix = '';
if (dupes.has(wrapper.var.name)) {
const i = counts.get(wrapper.var.name) || 0;
counts.set(wrapper.var.name, i + 1);
wrapper.var.name = this.get_unique_name(wrapper.var.name + i).name;
suffix = i;
}
wrapper.var.name = this.get_unique_name(wrapper.var.name + suffix).name;
}
}

@ -301,7 +301,7 @@ export default function dom(
return !variable || variable.hoistable;
})
.map(({ name }) => b`
${component.compile_options.dev && `@validate_store(${name.slice(1)}, '${name.slice(1)}');`}
${component.compile_options.dev && b`@validate_store(${name.slice(1)}, '${name.slice(1)}');`}
@component_subscribe($$self, ${name.slice(1)}, $$value => $$invalidate('${name}', ${name} = $$value));
`);

@ -271,8 +271,8 @@ export default class IfBlockWrapper extends Wrapper {
? b`
${snippet && (
dependencies.length > 0
? b`if ((${condition} == null) || ${changed(dependencies)}) ${condition} = !!(${snippet})`
: b`if (${condition} == null) ${condition} = !!(${snippet})`
? b`if (${condition} == null || ${changed(dependencies)}) ${condition} = !!${snippet}`
: b`if (${condition} == null) ${condition} = !!${snippet}`
)}
if (${condition}) return ${block.name};`
: b`return ${block.name};`)}
@ -388,7 +388,11 @@ export default class IfBlockWrapper extends Wrapper {
function ${select_block_type}(#changed, #ctx) {
${this.branches.map(({ dependencies, condition, snippet }, i) => condition
? b`
${snippet && b`if ((${condition} == null) || ${changed(dependencies)}) ${condition} = !!(${snippet})`}
${snippet && (
dependencies.length > 0
? b`if (${condition} == null || ${changed(dependencies)}) ${condition} = !!${snippet}`
: b`if (${condition} == null) ${condition} = !!${snippet}`
)}
if (${condition}) return ${i};`
: b`return ${i};`)}
${!has_else && b`return -1;`}

@ -137,12 +137,12 @@ export default class SlotWrapper extends Wrapper {
block.render_listeners(`_${slot.name}`);
block.event_listeners = listeners;
if (block.chunks.create) create.push(b`if (!${slot}) { ${block.chunks.create} }`);
if (block.chunks.claim) claim.push(b`if (!${slot}) { ${block.chunks.claim} }`);
if (block.chunks.hydrate) hydrate.push(b`if (!${slot}) { ${block.chunks.hydrate} }`);
if (block.chunks.mount) mount.push(b`if (!${slot}) { ${block.chunks.mount} }`);
if (block.chunks.update) update.push(b`if (!${slot}) { ${block.chunks.update} }`);
if (block.chunks.destroy) destroy.push(b`if (!${slot}) { ${block.chunks.destroy} }`);
if (block.chunks.create.length) create.push(b`if (!${slot}) { ${block.chunks.create} }`);
if (block.chunks.claim.length) claim.push(b`if (!${slot}) { ${block.chunks.claim} }`);
if (block.chunks.hydrate.length) hydrate.push(b`if (!${slot}) { ${block.chunks.hydrate} }`);
if (block.chunks.mount.length) mount.push(b`if (!${slot}) { ${block.chunks.mount} }`);
if (block.chunks.update.length) update.push(b`if (!${slot}) { ${block.chunks.update} }`);
if (block.chunks.destroy.length) destroy.push(b`if (!${slot}) { ${block.chunks.destroy} }`);
block.chunks.create = create;
block.chunks.claim = claim;
@ -155,9 +155,11 @@ export default class SlotWrapper extends Wrapper {
b`if (${slot}) ${slot}.c();`
);
if (renderer.options.hydratable) {
block.chunks.claim.push(
b`if (${slot}) ${slot}.l(${parent_nodes});`
);
}
block.chunks.mount.push(b`
if (${slot}) {

@ -4,13 +4,11 @@ const Parser = acorn.Parser;
export const parse = (source: string) => Parser.parse(source, {
sourceType: 'module',
// @ts-ignore TODO pending release of fixed types
ecmaVersion: 11,
locations: true
});
export const parse_expression_at = (source: string, index: number) => Parser.parseExpressionAt(source, index, {
// @ts-ignore TODO pending release of fixed types
ecmaVersion: 11,
locations: true
});

@ -45,7 +45,7 @@ export default function read_script(parser: Parser, start: number, attributes: N
let ast: Program;
try {
ast = acorn.parse(source);
ast = acorn.parse(source) as any as Program;
} catch (err) {
parser.acorn_error(err);
}

@ -60,7 +60,7 @@ function create_each_block(ctx) {
}
function create_fragment(ctx) {
let each_anchor;
let each_1_anchor;
let each_value = things;
let each_blocks = [];
@ -74,7 +74,7 @@ function create_fragment(ctx) {
each_blocks[i].c();
}
each_anchor = empty();
each_1_anchor = empty();
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
@ -84,7 +84,7 @@ function create_fragment(ctx) {
each_blocks[i].m(target, anchor);
}
insert_dev(target, each_anchor, anchor);
insert_dev(target, each_1_anchor, anchor);
},
p: function update(changed, ctx) {
if (changed.things) {
@ -99,7 +99,7 @@ function create_fragment(ctx) {
} else {
each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c();
each_blocks[i].m(each_anchor.parentNode, each_anchor);
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
}
}
@ -114,7 +114,7 @@ function create_fragment(ctx) {
o: noop,
d: function destroy(detaching) {
destroy_each(each_blocks, detaching);
if (detaching) detach_dev(each_anchor);
if (detaching) detach_dev(each_1_anchor);
}
};

@ -43,7 +43,7 @@ function create_each_block(ctx) {
}
function create_fragment(ctx) {
let each_anchor;
let each_1_anchor;
let each_value = ctx.createElement;
let each_blocks = [];
@ -57,14 +57,14 @@ function create_fragment(ctx) {
each_blocks[i].c();
}
each_anchor = empty();
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert(target, each_anchor, anchor);
insert(target, each_1_anchor, anchor);
},
p(changed, ctx) {
if (changed.createElement) {
@ -79,7 +79,7 @@ function create_fragment(ctx) {
} else {
each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c();
each_blocks[i].m(each_anchor.parentNode, each_anchor);
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
}
}
@ -94,7 +94,7 @@ function create_fragment(ctx) {
o: noop,
d(detaching) {
destroy_each(each_blocks, detaching);
if (detaching) detach(each_anchor);
if (detaching) detach(each_1_anchor);
}
};
}

@ -43,7 +43,7 @@ function create_each_block(ctx) {
}
function create_fragment(ctx) {
let each_anchor;
let each_1_anchor;
let each_value = [ctx.a, ctx.b, ctx.c, ctx.d, ctx.e];
let each_blocks = [];
@ -57,14 +57,14 @@ function create_fragment(ctx) {
each_blocks[i].c();
}
each_anchor = empty();
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < 5; i += 1) {
each_blocks[i].m(target, anchor);
}
insert(target, each_anchor, anchor);
insert(target, each_1_anchor, anchor);
},
p(changed, ctx) {
if (changed.a || changed.b || changed.c || changed.d || changed.e) {
@ -79,7 +79,7 @@ function create_fragment(ctx) {
} else {
each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c();
each_blocks[i].m(each_anchor.parentNode, each_anchor);
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
}
}
@ -92,7 +92,7 @@ function create_fragment(ctx) {
o: noop,
d(detaching) {
destroy_each(each_blocks, detaching);
if (detaching) detach(each_anchor);
if (detaching) detach(each_1_anchor);
}
};
}

@ -63,15 +63,15 @@ function create_each_block(key_1, ctx) {
function create_fragment(ctx) {
let each_blocks = [];
let each_lookup = new Map();
let each_anchor;
let each_1_lookup = new Map();
let each_1_anchor;
let each_value = ctx.things;
const get_key = ctx => ctx.thing.id;
for (let i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx);
each_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
}
return {
@ -80,19 +80,19 @@ function create_fragment(ctx) {
each_blocks[i].c();
}
each_anchor = empty();
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert(target, each_anchor, anchor);
insert(target, each_1_anchor, anchor);
},
p(changed, ctx) {
const each_value = ctx.things;
for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].r();
each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_lookup, each_anchor.parentNode, fix_and_destroy_block, create_each_block, each_anchor, get_each_context);
each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, fix_and_destroy_block, create_each_block, each_1_anchor, get_each_context);
for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].a();
},
i: noop,
@ -102,7 +102,7 @@ function create_fragment(ctx) {
each_blocks[i].d(detaching);
}
if (detaching) detach(each_anchor);
if (detaching) detach(each_1_anchor);
}
};
}

@ -48,15 +48,15 @@ function create_each_block(key_1, ctx) {
function create_fragment(ctx) {
let each_blocks = [];
let each_lookup = new Map();
let each_anchor;
let each_1_lookup = new Map();
let each_1_anchor;
let each_value = ctx.things;
const get_key = ctx => ctx.thing.id;
for (let i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx);
each_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
}
return {
@ -65,18 +65,18 @@ function create_fragment(ctx) {
each_blocks[i].c();
}
each_anchor = empty();
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert(target, each_anchor, anchor);
insert(target, each_1_anchor, anchor);
},
p(changed, ctx) {
const each_value = ctx.things;
each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_lookup, each_anchor.parentNode, destroy_block, create_each_block, each_anchor, get_each_context);
each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, destroy_block, create_each_block, each_1_anchor, get_each_context);
},
i: noop,
o: noop,
@ -85,7 +85,7 @@ function create_fragment(ctx) {
each_blocks[i].d(detaching);
}
if (detaching) detach(each_anchor);
if (detaching) detach(each_1_anchor);
}
};
}

@ -0,0 +1,4 @@
export default {
skip_if_ssr: true,
html: `<div>object</div>`
};

@ -0,0 +1,6 @@
<script>
import { writable } from 'svelte/store';
const foo = writable();
</script>
<div bind:this={$foo}>{typeof $foo}</div>

@ -0,0 +1,4 @@
export default {
html: `<text>hello world</text>`,
preserveIdentifiers: true,
};

@ -0,0 +1,5 @@
<script>
let foo = 'hello world'
</script>
<text>{foo}</text>

@ -0,0 +1,3 @@
export default {
html: `blah blah blah blah`
};

@ -0,0 +1,32 @@
<script>
import { writable } from 'svelte/store';
const foo = writable(true);
</script>
{#if $foo}
blah
{:else}
{#if bar()}
<Bar/>
{/if}
{/if}
{#if $foo}
blah
{:else}
{#if bar}
<Baz/>
{/if}
{/if}
{#if $foo}
blah
{:else if bar()}
<Bar/>
{/if}
{#if $foo}
blah
{:else if bar}
<Bar/>
{/if}

@ -1,4 +1,6 @@
export default {
compileOptions: { dev: true }, // tests `@validate_store` code generation
html: `
<p>42</p>
`

Loading…
Cancel
Save