mirror of https://github.com/sveltejs/svelte
chore: tidy up post-#10481 (#10503)
* simplify * replace snapshot test with runtime test * this is overkill --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/10499/head
parent
2c93c255f0
commit
a2014809ec
@ -0,0 +1,6 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
html: `<div>mounted</div>`,
|
||||||
|
ssrHtml: `<div>hello</div>`
|
||||||
|
});
|
@ -0,0 +1,9 @@
|
|||||||
|
<script>
|
||||||
|
import { writable } from 'svelte/store';
|
||||||
|
|
||||||
|
let action = writable((node) => {
|
||||||
|
node.textContent = 'mounted';
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div use:$action>hello</div>
|
@ -1,32 +0,0 @@
|
|||||||
// main.svelte (Svelte VERSION)
|
|
||||||
// Note: compiler output will change before 5.0 is released!
|
|
||||||
import "svelte/internal/disclose-version";
|
|
||||||
import * as $ from "svelte/internal";
|
|
||||||
import { writable } from 'svelte/store';
|
|
||||||
|
|
||||||
var frag = $.template(`<div>Hello!</div> <div>Hello!</div>`, true);
|
|
||||||
|
|
||||||
export default function Main($$anchor, $$props) {
|
|
||||||
$.push($$props, false);
|
|
||||||
|
|
||||||
const $$subscriptions = {};
|
|
||||||
|
|
||||||
$.unsubscribe_on_destroy($$subscriptions);
|
|
||||||
|
|
||||||
const $animate = () => $.store_get(animate, "$animate", $$subscriptions);
|
|
||||||
const animate = writable();
|
|
||||||
|
|
||||||
$.init();
|
|
||||||
|
|
||||||
/* Init */
|
|
||||||
var fragment = $.open_frag($$anchor, true, frag);
|
|
||||||
var div = $.child_frag(fragment);
|
|
||||||
|
|
||||||
$.in(div, $animate, () => ({ duration: 750, x: 0, y: -200 }), false);
|
|
||||||
|
|
||||||
var div_1 = $.sibling($.sibling(div, true));
|
|
||||||
|
|
||||||
$.action(div_1, ($$node) => $animate()($$node));
|
|
||||||
$.close_frag($$anchor, fragment);
|
|
||||||
$.pop();
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
// main.svelte (Svelte VERSION)
|
|
||||||
// Note: compiler output will change before 5.0 is released!
|
|
||||||
import * as $ from "svelte/internal/server";
|
|
||||||
import { writable } from 'svelte/store';
|
|
||||||
|
|
||||||
export default function Main($$payload, $$props) {
|
|
||||||
$.push(false);
|
|
||||||
|
|
||||||
const animate = writable();
|
|
||||||
|
|
||||||
$$payload.out += `<div>Hello!</div> <div>Hello!</div>`;
|
|
||||||
$.pop();
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { writable, } from 'svelte/store';
|
|
||||||
|
|
||||||
const animate = writable();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div in:$animate={{ duration: 750, x:0, y: -200}}>Hello!</div>
|
|
||||||
<div use:$animate>Hello!</div>
|
|
Loading…
Reference in new issue