insert consecutive nodes in one go

pull/1799/head
Rich Harris 8 years ago
parent 7f709cef10
commit 1a92b76a4a

@ -211,7 +211,7 @@ export default class Block {
if (this.first) {
properties.addBlock(`first: null,`);
this.builders.hydrate.addLine(`this.first = ${this.first};`);
this.builders.mount.addLineAtStart(`@insertNode(${this.first}, #target, anchor);`);
this.builders.mount.addLineAtStart(`@insert(#target, anchor, ${this.first});`);
}
if (this.builders.create.isEmpty()) {

@ -160,7 +160,7 @@ export default function dom(
var style = @createElement("style");
style.id = '${generator.stylesheet.id}-style';
style.textContent = ${styles};
@appendNode(style, document.head);
@append(document.head, style);
}
`);
}

@ -5,8 +5,32 @@ import Block from './Block';
export default function mountChildren(node: Node, parentNode?: string) {
const builder = new CodeBuilder();
let consecutiveNodes: string[] = [];
function flush() {
if (consecutiveNodes.length === 0) return;
if (parentNode) {
if (consecutiveNodes.length === 1) {
builder.addLine(`@append(${parentNode}, ${consecutiveNodes[0]});`);
} else {
builder.addLine(`@appendAll(${parentNode}, [${consecutiveNodes.join(', ')}]);`);
}
} else {
if (consecutiveNodes.length === 1) {
builder.addLine(`@insert(#target, anchor, ${consecutiveNodes[0]});`);
} else {
builder.addLine(`@insertAll(#target, anchor, [${consecutiveNodes.join(', ')}]);`);
}
}
consecutiveNodes = [];
}
node.children.forEach((child: Node) => {
if (child.mountStatement) {
flush();
// TODO determining whether to use line or block should probably
// happen inside CodeBuilder
if (/\n/.test(child.mountStatement)) {
@ -18,13 +42,11 @@ export default function mountChildren(node: Node, parentNode?: string) {
if (child.shouldSkip) return;
if (child.type === 'Element' && child.name === ':Window') return;
if (parentNode) {
builder.addLine(`@appendNode(${child.var}, ${parentNode});`);
} else {
builder.addLine(`@insertNode(${child.var}, #target, anchor);`);
}
consecutiveNodes.push(child.var);
}
});
flush();
return builder;
}

@ -129,7 +129,7 @@ export default function visitEachBlock(
// TODO do this elsewhere?
if (needsAnchor) node.mountStatement += '\n\n' + (
state.parentNode ? `@appendNode(${anchor}, ${state.parentNode});` : `@insertNode(${anchor}, #target, anchor);`
state.parentNode ? `@append(${state.parentNode}, ${anchor});` : `@insert(#target, anchor, ${anchor});`
);
node.children.forEach((child: Node) => {

@ -90,7 +90,7 @@ export default function visitElement(
// TODO this is kinda messy — this is a hack to prevent the mount statement
// going in the usual place
if (node.slotted) {
node.mountStatement = `@appendNode(${node.var}, ${parentNode});`;
node.mountStatement = `@append(${parentNode}, ${node.var});`;
}
// add CSS encapsulation attribute

@ -133,7 +133,7 @@ export default function visitIfBlock(
// TODO do this elsewhere?
node.mountStatement += '\n\n' + (
state.parentNode ? `@appendNode(${anchor}, ${state.parentNode})` : `@insertNode(${anchor}, #target, anchor)`
state.parentNode ? `@append(${state.parentNode}, ${anchor})` : `@insert(#target, anchor, ${anchor})`
);
}
}

@ -66,7 +66,7 @@ export default function visitRawMustacheTag(
);
mountStatements.push(
state.parentNode ? `@appendNode(${anchorBefore}, ${state.parentNode});` : `@insertNode(${anchorBefore}, #target, anchor);`
state.parentNode ? `@append(${state.parentNode}, ${anchorBefore});` : `@insert(#target, anchor, ${anchorBefore});`
);
}
@ -79,7 +79,7 @@ export default function visitRawMustacheTag(
);
mountStatements.push(
state.parentNode ? `@appendNode(${anchorAfter}, ${state.parentNode});` : `@insertNode(${anchorAfter}, #target, anchor);`
state.parentNode ? `@append(${state.parentNode}, ${anchorAfter});` : `@insert(#target, anchor, ${anchorAfter});`
);
}

@ -42,9 +42,9 @@ export default function visitSlot(
if (state.parentNode) {
node.mountStatement = deindent`
if (${content_name}) {
${needsAnchorBefore && `@appendNode(${anchorBefore} || (${anchorBefore} = @createComment()), ${state.parentNode});`}
@appendNode(${content_name}, ${state.parentNode});
${needsAnchorAfter && `@appendNode(${anchorAfter} || (${anchorAfter} = @createComment()), ${state.parentNode});`}
${needsAnchorBefore && `@append(${state.parentNode}, ${anchorBefore} || (${anchorBefore} = @createComment()));`}
@append(${state.parentNode}, ${content_name});
${needsAnchorAfter && `@append(${state.parentNode}, ${anchorAfter} || (${anchorAfter} = @createComment()));`}
} else {
${mountChildren(node, state.parentNode)}
}
@ -52,9 +52,9 @@ export default function visitSlot(
} else {
node.mountStatement = deindent`
if (${content_name}) {
${needsAnchorBefore && `@insertNode(${anchorBefore} || (${anchorBefore} = @createComment()), #target, anchor);`}
@insertNode(${content_name}, #target, anchor);
${needsAnchorAfter && `@insertNode(${anchorAfter} || (${anchorAfter} = @createComment()), #target, anchor);`}
${needsAnchorBefore && `@insert(#target, anchor, ${anchorBefore} || (${anchorBefore} = @createComment()));`}
@insert(#target, anchor, ${content_name});
${needsAnchorAfter && `@insert(#target, anchor, ${anchorAfter} || (${anchorAfter} = @createComment()));`}
} else {
${mountChildren(node, state.parentNode)}
}

@ -1,7 +1,28 @@
export function append(parent, child) {
parent.appendChild(child);
}
export function appendAll(parent, children) {
for (var i = 0; i < children.length; i += 1) {
parent.appendChild(children[i]);
}
}
// TODO remove
export function appendNode(node, target) {
target.appendChild(node);
}
export function insert(parent, next, child) {
parent.insertBefore(child, next);
}
export function insertAll(parent, next, children) {
for (var i = 0; i < children.length; i += 1) {
parent.insertBefore(children[i], next);
}
}
export function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
}

@ -13,12 +13,12 @@ function assign(target) {
return target;
}
function appendNode(node, target) {
target.appendChild(node);
function append(parent, child) {
parent.appendChild(child);
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -202,7 +202,7 @@ function add_css() {
var style = createElement("style");
style.id = 'svelte-3590263702-style';
style.textContent = "p[svelte-3590263702],[svelte-3590263702] p{color:red}";
appendNode(style, document.head);
append(document.head, style);
}
function create_main_fragment(state, component) {
@ -220,8 +220,9 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
appendNode(text, p);
append(p, text);
insert(target, anchor, p);
},
p: function update(changed, state) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
import { append, assign, createElement, createText, detachNode, init, insert, noop, proto, setAttribute } from "svelte/shared.js";
function data() {
return { foo: 42 }
@ -13,7 +13,7 @@ function add_css() {
var style = createElement("style");
style.id = 'svelte-3590263702-style';
style.textContent = "p[svelte-3590263702],[svelte-3590263702] p{color:red}";
appendNode(style, document.head);
append(document.head, style);
}
function create_main_fragment(state, component) {
@ -31,8 +31,9 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
appendNode(text, p);
append(p, text);
insert(target, anchor, p);
},
p: function update(changed, state) {

@ -13,12 +13,12 @@ function assign(target) {
return target;
}
function appendNode(node, target) {
target.appendChild(node);
function append(parent, child) {
parent.appendChild(child);
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -194,7 +194,7 @@ function add_css() {
var style = createElement("style");
style.id = 'svelte-2363328337-style';
style.textContent = "@media(min-width: 1px){div[svelte-2363328337],[svelte-2363328337] div{color:red}}";
appendNode(style, document.head);
append(document.head, style);
}
function create_main_fragment(state, component) {
@ -211,7 +211,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: noop,

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
import { append, assign, createElement, detachNode, init, insert, noop, proto, setAttribute } from "svelte/shared.js";
function encapsulateStyles(node) {
setAttribute(node, "svelte-2363328337", "");
@ -9,7 +9,7 @@ function add_css() {
var style = createElement("style");
style.id = 'svelte-2363328337-style';
style.textContent = "@media(min-width: 1px){div[svelte-2363328337],[svelte-2363328337] div{color:red}}";
appendNode(style, document.head);
append(document.head, style);
}
function create_main_fragment(state, component) {
@ -26,7 +26,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: noop,

@ -13,8 +13,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -188,7 +188,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: noop,

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div;
@ -11,7 +11,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: noop,

@ -13,12 +13,24 @@ function assign(target) {
return target;
}
function appendNode(node, target) {
target.appendChild(node);
function append(parent, child) {
parent.appendChild(child);
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function appendAll(parent, children) {
for (var i = 0; i < children.length; i += 1) {
parent.appendChild(children[i]);
}
}
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function insertAll(parent, next, children) {
for (var i = 0; i < children.length; i += 1) {
parent.insertBefore(children[i], next);
}
}
function detachNode(node) {
@ -221,13 +233,13 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
append(p, text_1);
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insertNode(text, target, anchor);
insertNode(p, target, anchor);
appendNode(text_1, p);
insertAll(target, anchor, [text, p]);
},
p: function update(changed, state) {
@ -297,18 +309,16 @@ function create_each_block(state, comments, comment, i, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
appendNode(strong, div);
appendNode(text, strong);
appendNode(text_1, div);
appendNode(span, div);
appendNode(text_2, span);
appendNode(text_3, span);
appendNode(text_4, span);
appendNode(text_5, span);
appendNode(text_6, div);
appendNode(raw_before, div);
append(strong, text);
appendAll(span, [text_2, text_3, text_4, text_5]);
appendAll(div, [strong, text_1, span, text_6]);
append(div, raw_before);
raw_before.insertAdjacentHTML("afterend", raw_value);
insert(target, anchor, div);
},
p: function update(changed, state, comments, comment, i) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { append, appendAll, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insert, insertAll, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var text, p, text_1;
@ -24,13 +24,13 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
append(p, text_1);
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insertNode(text, target, anchor);
insertNode(p, target, anchor);
appendNode(text_1, p);
insertAll(target, anchor, [text, p]);
},
p: function update(changed, state) {
@ -100,18 +100,16 @@ function create_each_block(state, comments, comment, i, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
appendNode(strong, div);
appendNode(text, strong);
appendNode(text_1, div);
appendNode(span, div);
appendNode(text_2, span);
appendNode(text_3, span);
appendNode(text_4, span);
appendNode(text_5, span);
appendNode(text_6, div);
appendNode(raw_before, div);
append(strong, text);
appendAll(span, [text_2, text_3, text_4, text_5]);
appendAll(div, [strong, text_1, span, text_6]);
append(div, raw_before);
raw_before.insertAdjacentHTML("afterend", raw_value);
insert(target, anchor, div);
},
p: function update(changed, state, comments, comment, i) {

@ -13,8 +13,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -206,7 +206,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(button, target, anchor);
insert(target, anchor, button);
},
p: noop,

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js";
function foo( node, callback ) {
// code goes here
@ -29,7 +29,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(button, target, anchor);
insert(target, anchor, button);
},
p: noop,

@ -13,8 +13,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -196,7 +196,8 @@ function create_main_fragment(state, component) {
m: function mount(target, anchor) {
if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
insert(target, anchor, if_block_anchor);
},
p: function update(changed, state) {
@ -231,7 +232,7 @@ function create_if_block(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {
@ -253,7 +254,7 @@ function create_if_block_1(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, createComment, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var if_block_anchor;
@ -15,7 +15,8 @@ function create_main_fragment(state, component) {
m: function mount(target, anchor) {
if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
insert(target, anchor, if_block_anchor)
},
p: function update(changed, state) {
@ -50,7 +51,7 @@ function create_if_block(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {
@ -72,7 +73,7 @@ function create_if_block_1(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {

@ -13,8 +13,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -195,7 +195,8 @@ function create_main_fragment(state, component) {
m: function mount(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
insert(target, anchor, if_block_anchor);
},
p: function update(changed, state) {
@ -234,7 +235,7 @@ function create_if_block(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, createComment, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var if_block_anchor;
@ -14,7 +14,8 @@ function create_main_fragment(state, component) {
m: function mount(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
insert(target, anchor, if_block_anchor)
},
p: function update(changed, state) {
@ -53,7 +54,7 @@ function create_if_block(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {

@ -13,8 +13,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -197,7 +197,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: function update(changed, state) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
import { assign, createElement, detachNode, init, insert, noop, proto, setStyle } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div;
@ -16,7 +16,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: function update(changed, state) {

@ -13,8 +13,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -196,7 +196,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: function update(changed, state) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
import { assign, createElement, detachNode, init, insert, noop, proto, setStyle } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div;
@ -15,7 +15,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: function update(changed, state) {

@ -13,8 +13,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -196,7 +196,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: function update(changed, state) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
import { assign, createElement, detachNode, init, insert, noop, proto, setStyle } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div;
@ -15,7 +15,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: function update(changed, state) {

@ -13,8 +13,10 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insertAll(parent, next, children) {
for (var i = 0; i < children.length; i += 1) {
parent.insertBefore(children[i], next);
}
}
function detachNode(node) {
@ -199,9 +201,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insertNode(text, target, anchor);
insertNode(div_1, target, anchor);
insertAll(target, anchor, [div, text, div_1]);
},
p: function update(changed, state) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, createElement, createText, detachNode, init, insertAll, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div, text, div_1, div_1_style_value;
@ -18,9 +18,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insertNode(text, target, anchor);
insertNode(div_1, target, anchor);
insertAll(target, anchor, [div, text, div_1]);
},
p: function update(changed, state) {

@ -13,8 +13,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -205,9 +205,9 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(input, target, anchor);
input.checked = state.foo;
insert(target, anchor, input);
},
p: function update(changed, state) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { addListener, assign, createElement, detachNode, init, insertNode, proto, removeListener } from "svelte/shared.js";
import { addListener, assign, createElement, detachNode, init, insert, proto, removeListener } from "svelte/shared.js";
function create_main_fragment(state, component) {
var input;
@ -20,9 +20,9 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(input, target, anchor);
input.checked = state.foo;
insert(target, anchor, input);
},
p: function update(changed, state) {

@ -13,8 +13,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -198,7 +198,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(input, target, anchor);
insert(target, anchor, input);
},
p: noop,

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setInputType } from "svelte/shared.js";
import { assign, createElement, detachNode, init, insert, noop, proto, setInputType } from "svelte/shared.js";
function create_main_fragment(state, component) {
var input;
@ -15,7 +15,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(input, target, anchor);
insert(target, anchor, input);
},
p: noop,

@ -13,8 +13,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -223,7 +223,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: noop,

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, children, claimElement, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, children, claimElement, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div;
@ -23,7 +23,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insert(target, anchor, div);
},
p: noop,

@ -13,8 +13,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -270,7 +270,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(audio, target, anchor);
insert(target, anchor, audio);
},
p: function update(changed, state) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { addListener, assign, callAll, createElement, detachNode, init, insertNode, proto, removeListener, timeRangesToArray } from "svelte/shared.js";
import { addListener, assign, callAll, createElement, detachNode, init, insert, proto, removeListener, timeRangesToArray } from "svelte/shared.js";
function create_main_fragment(state, component) {
var audio, audio_updating = false, audio_animationframe, audio_paused_value = true;
@ -77,7 +77,7 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(audio, target, anchor);
insert(target, anchor, audio);
},
p: function update(changed, state) {

@ -15,8 +15,8 @@ function assign(target) {
return target;
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function detachNode(node) {
@ -200,7 +200,7 @@ function create_main_fragment(state, component) {
m: function mount(target, anchor) {
imported._mount(target, anchor);
insertNode(text, target, anchor);
insert(target, anchor, text);
nonimported._mount(target, anchor);
},

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, callAll, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, callAll, createText, detachNode, init, insert, noop, proto } from "svelte/shared.js";
import Imported from 'Imported.html';
@ -24,7 +24,7 @@ function create_main_fragment(state, component) {
m: function mount(target, anchor) {
imported._mount(target, anchor);
insertNode(text, target, anchor);
insert(target, anchor, text);
nonimported._mount(target, anchor);
},

@ -13,12 +13,24 @@ function assign(target) {
return target;
}
function appendNode(node, target) {
target.appendChild(node);
function append(parent, child) {
parent.appendChild(child);
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
function appendAll(parent, children) {
for (var i = 0; i < children.length; i += 1) {
parent.appendChild(children[i]);
}
}
function insert(parent, next, child) {
parent.insertBefore(child, next);
}
function insertAll(parent, next, children) {
for (var i = 0; i < children.length; i += 1) {
parent.insertBefore(children[i], next);
}
}
function detachNode(node) {
@ -225,21 +237,19 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
if (if_block) if_block.m(div, null);
appendNode(text, div);
appendNode(p, div);
appendNode(text_2, div);
appendAll(div, [text, p, text_2]);
if (if_block_1) if_block_1.m(div, null);
appendNode(text_3, div);
append(div, text_3);
if (if_block_2) if_block_2.m(div, null);
appendNode(text_4, div);
appendNode(p_1, div);
appendNode(text_6, div);
appendAll(div, [text_4, p_1, text_6]);
if (if_block_3) if_block_3.m(div, null);
insertNode(text_8, target, anchor);
insertAll(target, anchor, [div, text_8]);
if (if_block_4) if_block_4.m(target, anchor);
insertNode(if_block_4_anchor, target, anchor);
insert(target, anchor, if_block_4_anchor);
},
p: function update(changed, state) {
@ -336,7 +346,7 @@ function create_if_block(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {
@ -358,7 +368,7 @@ function create_if_block_1(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {
@ -380,7 +390,7 @@ function create_if_block_2(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {
@ -402,7 +412,7 @@ function create_if_block_3(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {
@ -424,7 +434,7 @@ function create_if_block_4(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { append, appendAll, assign, createComment, createElement, createText, detachNode, init, insert, insertAll, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div, text, p, text_2, text_3, text_4, p_1, text_6, text_8, if_block_4_anchor;
@ -36,21 +36,19 @@ function create_main_fragment(state, component) {
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
if (if_block) if_block.m(div, null);
appendNode(text, div);
appendNode(p, div);
appendNode(text_2, div);
appendAll(div, [text, p, text_2]);
if (if_block_1) if_block_1.m(div, null);
appendNode(text_3, div);
append(div, text_3);
if (if_block_2) if_block_2.m(div, null);
appendNode(text_4, div);
appendNode(p_1, div);
appendNode(text_6, div);
appendAll(div, [text_4, p_1, text_6]);
if (if_block_3) if_block_3.m(div, null);
insertNode(text_8, target, anchor);
insertAll(target, anchor, [div, text_8]);
if (if_block_4) if_block_4.m(target, anchor);
insertNode(if_block_4_anchor, target, anchor);
insert(target, anchor, if_block_4_anchor)
},
p: function update(changed, state) {
@ -147,7 +145,7 @@ function create_if_block(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {
@ -169,7 +167,7 @@ function create_if_block_1(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {
@ -191,7 +189,7 @@ function create_if_block_2(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {
@ -213,7 +211,7 @@ function create_if_block_3(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {
@ -235,7 +233,7 @@ function create_if_block_4(state, component) {
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
insert(target, anchor, p);
},
u: function unmount() {

Loading…
Cancel
Save