Skip to content

Commit

Permalink
chore: add snapshots for non static nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloricciuti committed Nov 11, 2024
1 parent 6c7cded commit 88b1115
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "svelte/internal/disclose-version";
import * as $ from "svelte/internal/client";

var root = $.template(`<header><nav><a href="/">Home</a> <a href="/away">Away</a></nav></header> <main><h1> </h1> <div class="static"><p>we don't need to traverse these nodes</p></div> <p>or</p> <p>these</p> <p>ones</p> <!> <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></custom-elements></cant-skip>`, 3);
var root = $.template(`<header><nav><a href="/">Home</a> <a href="/away">Away</a></nav></header> <main><h1> </h1> <div class="static"><p>we don't need to traverse these nodes</p></div> <p>or</p> <p>these</p> <p>ones</p> <!> <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></custom-elements></cant-skip> <div><input></div> <div><source></div> <select><option>a</option></select> <img src="..." alt="" loading="lazy">`, 3);

export default function Skip_static_subtree($$anchor, $$props) {
var fragment = root();
Expand All @@ -22,6 +22,28 @@ export default function Skip_static_subtree($$anchor, $$props) {

$.set_custom_element_data(custom_elements, "with", "attributes");
$.reset(cant_skip);

var div = $.sibling(cant_skip, 2);
var input = $.child(div);

$.autofocus(input, true);
$.reset(div);

var div_1 = $.sibling(div, 2);
var source = $.child(div_1);

source.muted = true;
$.reset(div_1);

var select = $.sibling(div_1, 2);
var option = $.child(select);

option.value = null == (option.__value = "a") ? "" : "a";
$.reset(select);

var img = $.sibling(select, 2);

$.template_effect(() => $.set_text(text, $$props.title));
$.handle_lazy_img(img);
$.append($$anchor, fragment);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import * as $ from "svelte/internal/server";
export default function Skip_static_subtree($$payload, $$props) {
let { title, content } = $$props;

$$payload.out += `<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>`;
$$payload.out += `<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">a</option></select> <img src="..." alt="" loading="lazy">`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,18 @@
<cant-skip>
<custom-elements with="attributes"></custom-elements>
</cant-skip>

<div>
<!-- svelte-ignore a11y_autofocus -->
<input autofocus />
</div>

<div>
<source muted />
</div>

<select>
<option value="a">a</option>
</select>

<img src="..." alt="" loading="lazy" />

0 comments on commit 88b1115

Please sign in to comment.