mirror of https://github.com/sveltejs/svelte
parent
c5b639c108
commit
0cb62125c1
@ -1,5 +1,7 @@
|
|||||||
import * as $ from 'svelte/internal/server';
|
import * as $ from 'svelte/internal/server';
|
||||||
|
|
||||||
export default function Bind_this($$payload) {
|
export default function Bind_this($$payload) {
|
||||||
|
$$payload.child(({ $$payload }) => {
|
||||||
Foo($$payload, {});
|
Foo($$payload, {});
|
||||||
|
});
|
||||||
}
|
}
|
@ -1,10 +1,10 @@
|
|||||||
import * as $ from 'svelte/internal/server';
|
import * as $ from 'svelte/internal/server';
|
||||||
|
|
||||||
export default function Main($$payload) {
|
export default function Main($$payload) {
|
||||||
// needs to be a snapshot test because jsdom does auto-correct the attribute casing
|
$$payload.child(({ $$payload }) => {
|
||||||
let x = 'test';
|
let x = 'test';
|
||||||
|
|
||||||
let y = () => 'test';
|
let y = () => 'test';
|
||||||
|
|
||||||
$$payload.out.push(`<div${$.attr('foobar', x)}></div> <svg${$.attr('viewBox', x)}></svg> <custom-element${$.attr('foobar', x)}></custom-element> <div${$.attr('foobar', y())}></div> <svg${$.attr('viewBox', y())}></svg> <custom-element${$.attr('foobar', y())}></custom-element>`);
|
$$payload.out.push(`<div${$.attr('foobar', x)}></div> <svg${$.attr('viewBox', x)}></svg> <custom-element${$.attr('foobar', x)}></custom-element> <div${$.attr('foobar', y())}></div> <svg${$.attr('viewBox', y())}></svg> <custom-element${$.attr('foobar', y())}></custom-element>`);
|
||||||
|
});
|
||||||
}
|
}
|
@ -1,5 +1,7 @@
|
|||||||
import * as $ from 'svelte/internal/server';
|
import * as $ from 'svelte/internal/server';
|
||||||
|
|
||||||
export default function Functional_templating($$payload) {
|
export default function Functional_templating($$payload) {
|
||||||
|
$$payload.child(({ $$payload }) => {
|
||||||
$$payload.out.push(`<h1>hello</h1> <div class="potato"><p>child element</p> <p>another child element</p></div>`);
|
$$payload.out.push(`<h1>hello</h1> <div class="potato"><p>child element</p> <p>another child element</p></div>`);
|
||||||
|
});
|
||||||
}
|
}
|
@ -1,5 +1,7 @@
|
|||||||
import * as $ from 'svelte/internal/server';
|
import * as $ from 'svelte/internal/server';
|
||||||
|
|
||||||
export default function Hello_world($$payload) {
|
export default function Hello_world($$payload) {
|
||||||
|
$$payload.child(({ $$payload }) => {
|
||||||
$$payload.out.push(`<h1>hello world</h1>`);
|
$$payload.out.push(`<h1>hello world</h1>`);
|
||||||
|
});
|
||||||
}
|
}
|
@ -1,5 +1,7 @@
|
|||||||
import * as $ from 'svelte/internal/server';
|
import * as $ from 'svelte/internal/server';
|
||||||
|
|
||||||
export default function Hmr($$payload) {
|
export default function Hmr($$payload) {
|
||||||
|
$$payload.child(({ $$payload }) => {
|
||||||
$$payload.out.push(`<h1>hello world</h1>`);
|
$$payload.out.push(`<h1>hello world</h1>`);
|
||||||
|
});
|
||||||
}
|
}
|
@ -1,4 +1,6 @@
|
|||||||
import * as $ from 'svelte/internal/server';
|
import * as $ from 'svelte/internal/server';
|
||||||
import { random } from './module.svelte';
|
import { random } from './module.svelte';
|
||||||
|
|
||||||
export default function Imports_in_modules($$payload) {}
|
export default function Imports_in_modules($$payload) {
|
||||||
|
$$payload.child(({ $$payload }) => {});
|
||||||
|
}
|
@ -1,8 +1,10 @@
|
|||||||
import * as $ from 'svelte/internal/server';
|
import * as $ from 'svelte/internal/server';
|
||||||
|
|
||||||
export default function Nullish_coallescence_omittance($$payload) {
|
export default function Nullish_coallescence_omittance($$payload) {
|
||||||
|
$$payload.child(({ $$payload }) => {
|
||||||
let name = 'world';
|
let name = 'world';
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
|
||||||
$$payload.out.push(`<h1>Hello, world!</h1> <b>123</b> <button>Count is ${$.escape(count)}</button> <h1>Hello, world</h1>`);
|
$$payload.out.push(`<h1>Hello, world!</h1> <b>123</b> <button>Count is ${$.escape(count)}</button> <h1>Hello, world</h1>`);
|
||||||
|
});
|
||||||
}
|
}
|
@ -1,7 +1,9 @@
|
|||||||
import * as $ from 'svelte/internal/server';
|
import * as $ from 'svelte/internal/server';
|
||||||
|
|
||||||
export default function Purity($$payload) {
|
export default function Purity($$payload) {
|
||||||
|
$$payload.child(({ $$payload }) => {
|
||||||
$$payload.out.push(`<p>0</p> <p>${$.escape(location.href)}</p> `);
|
$$payload.out.push(`<p>0</p> <p>${$.escape(location.href)}</p> `);
|
||||||
Child($$payload, { prop: encodeURIComponent('hello') });
|
Child($$payload, { prop: encodeURIComponent('hello') });
|
||||||
$$payload.out.push(`<!---->`);
|
$$payload.out.push(`<!---->`);
|
||||||
|
});
|
||||||
}
|
}
|
@ -1,7 +1,9 @@
|
|||||||
import * as $ from 'svelte/internal/server';
|
import * as $ from 'svelte/internal/server';
|
||||||
|
|
||||||
export default function Skip_static_subtree($$payload, $$props) {
|
export default function Skip_static_subtree($$payload, $$props) {
|
||||||
|
$$payload.child(({ $$payload }) => {
|
||||||
let { title, content } = $$props;
|
let { title, content } = $$props;
|
||||||
|
|
||||||
$$payload.out.push(`<header><nav><a href="/">Home</a> <a href="/away">Away</a></nav></header> <main><h1>${$.escape(title)}</h1> <div class="static"><p>we don't need to traverse these nodes</p></div> <p>or</p> <p>these</p> <p>ones</p> ${$.html(content)} <p>these</p> <p>trailing</p> <p>nodes</p> <p>can</p> <p>be</p> <p>completely</p> <p>ignored</p></main> <cant-skip><custom-elements with="attributes"></custom-elements></cant-skip> <div><input autofocus/></div> <div><source muted/></div> <select><option value="a"${$.maybe_selected($$payload, 'a')}>a</option></select> <img src="..." alt="" loading="lazy"/> <div><img src="..." alt="" loading="lazy"/></div>`);
|
$$payload.out.push(`<header><nav><a href="/">Home</a> <a href="/away">Away</a></nav></header> <main><h1>${$.escape(title)}</h1> <div class="static"><p>we don't need to traverse these nodes</p></div> <p>or</p> <p>these</p> <p>ones</p> ${$.html(content)} <p>these</p> <p>trailing</p> <p>nodes</p> <p>can</p> <p>be</p> <p>completely</p> <p>ignored</p></main> <cant-skip><custom-elements with="attributes"></custom-elements></cant-skip> <div><input autofocus/></div> <div><source muted/></div> <select><option value="a"${$.maybe_selected($$payload, 'a')}>a</option></select> <img src="..." alt="" loading="lazy"/> <div><img src="..." alt="" loading="lazy"/></div>`);
|
||||||
|
});
|
||||||
}
|
}
|
@ -1,7 +1,9 @@
|
|||||||
import * as $ from 'svelte/internal/server';
|
import * as $ from 'svelte/internal/server';
|
||||||
|
|
||||||
export default function Svelte_element($$payload, $$props) {
|
export default function Svelte_element($$payload, $$props) {
|
||||||
|
$$payload.child(({ $$payload }) => {
|
||||||
let { tag = 'hr' } = $$props;
|
let { tag = 'hr' } = $$props;
|
||||||
|
|
||||||
$.element($$payload, tag);
|
$.element($$payload, tag);
|
||||||
|
});
|
||||||
}
|
}
|
Loading…
Reference in new issue