mirror of https://github.com/sveltejs/svelte
				
				
				
			merge local branches (#16757)
	
		
	
				
					
				
			* use fragment as async hoist boundary * remove async_hoist_boundary * only dewaterfall when necessary * unused * simplify/fix * de-waterfall awaits in separate elements * update snapshots * remove unnecessary wrapper * fix * fix * remove suspends_without_fallback --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/16762/head
							parent
							
								
									127c5a73cb
								
							
						
					
					
						commit
						49241764bd
					
				@ -1,26 +1,23 @@
 | 
				
			||||
import * as $ from 'svelte/internal/server';
 | 
				
			||||
 | 
				
			||||
export default function Async_each_hoisting($$payload) {
 | 
				
			||||
	$$payload.child(async ($$payload) => {
 | 
				
			||||
	const first = Promise.resolve(1);
 | 
				
			||||
	const second = Promise.resolve(2);
 | 
				
			||||
	const third = Promise.resolve(3);
 | 
				
			||||
		const promises = [Promise.resolve([first, second, third])];
 | 
				
			||||
		const each_array = $.ensure_array_like(await promises[0]);
 | 
				
			||||
 | 
				
			||||
	$$payload.child(async ($$payload) => {
 | 
				
			||||
		const each_array = $.ensure_array_like(await Promise.resolve([first, second, third]));
 | 
				
			||||
 | 
				
			||||
		$$payload.push(`<!--[-->`);
 | 
				
			||||
 | 
				
			||||
		for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
 | 
				
			||||
			let item = each_array[$$index];
 | 
				
			||||
				const promises_1 = [item];
 | 
				
			||||
 | 
				
			||||
			$$payload.child(async ($$payload) => {
 | 
				
			||||
					$$payload.push(`<!---->${$.escape(await promises_1[0])}`);
 | 
				
			||||
				$$payload.push(`<!---->${$.escape(await item)}`);
 | 
				
			||||
			});
 | 
				
			||||
		}
 | 
				
			||||
 | 
				
			||||
		$$payload.push(`<!--]-->`);
 | 
				
			||||
	});
 | 
				
			||||
	});
 | 
				
			||||
}
 | 
				
			||||
@ -1,7 +1,5 @@
 | 
				
			||||
import * as $ from 'svelte/internal/server';
 | 
				
			||||
 | 
				
			||||
export default function Bind_this($$payload) {
 | 
				
			||||
	$$payload.child(($$payload) => {
 | 
				
			||||
	Foo($$payload, {});
 | 
				
			||||
	});
 | 
				
			||||
}
 | 
				
			||||
@ -1,10 +1,10 @@
 | 
				
			||||
import * as $ from 'svelte/internal/server';
 | 
				
			||||
 | 
				
			||||
export default function Main($$payload) {
 | 
				
			||||
	$$payload.child(($$payload) => {
 | 
				
			||||
	// needs to be a snapshot test because jsdom does auto-correct the attribute casing
 | 
				
			||||
	let x = 'test';
 | 
				
			||||
 | 
				
			||||
	let y = () => 'test';
 | 
				
			||||
 | 
				
			||||
	$$payload.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,7 +1,5 @@
 | 
				
			||||
import * as $ from 'svelte/internal/server';
 | 
				
			||||
 | 
				
			||||
export default function Functional_templating($$payload) {
 | 
				
			||||
	$$payload.child(($$payload) => {
 | 
				
			||||
	$$payload.push(`<h1>hello</h1> <div class="potato"><p>child element</p> <p>another child element</p></div>`);
 | 
				
			||||
	});
 | 
				
			||||
}
 | 
				
			||||
@ -1,7 +1,5 @@
 | 
				
			||||
import * as $ from 'svelte/internal/server';
 | 
				
			||||
 | 
				
			||||
export default function Hello_world($$payload) {
 | 
				
			||||
	$$payload.child(($$payload) => {
 | 
				
			||||
	$$payload.push(`<h1>hello world</h1>`);
 | 
				
			||||
	});
 | 
				
			||||
}
 | 
				
			||||
@ -1,7 +1,5 @@
 | 
				
			||||
import * as $ from 'svelte/internal/server';
 | 
				
			||||
 | 
				
			||||
export default function Hmr($$payload) {
 | 
				
			||||
	$$payload.child(($$payload) => {
 | 
				
			||||
	$$payload.push(`<h1>hello world</h1>`);
 | 
				
			||||
	});
 | 
				
			||||
}
 | 
				
			||||
@ -1,6 +1,4 @@
 | 
				
			||||
import * as $ from 'svelte/internal/server';
 | 
				
			||||
import { random } from './module.svelte';
 | 
				
			||||
 | 
				
			||||
export default function Imports_in_modules($$payload) {
 | 
				
			||||
	$$payload.child(($$payload) => {});
 | 
				
			||||
}
 | 
				
			||||
export default function Imports_in_modules($$payload) {}
 | 
				
			||||
@ -1,10 +1,8 @@
 | 
				
			||||
import * as $ from 'svelte/internal/server';
 | 
				
			||||
 | 
				
			||||
export default function Nullish_coallescence_omittance($$payload) {
 | 
				
			||||
	$$payload.child(($$payload) => {
 | 
				
			||||
	let name = 'world';
 | 
				
			||||
	let count = 0;
 | 
				
			||||
 | 
				
			||||
	$$payload.push(`<h1>Hello, world!</h1> <b>123</b> <button>Count is ${$.escape(count)}</button> <h1>Hello, world</h1>`);
 | 
				
			||||
	});
 | 
				
			||||
}
 | 
				
			||||
@ -1,9 +1,7 @@
 | 
				
			||||
import * as $ from 'svelte/internal/server';
 | 
				
			||||
 | 
				
			||||
export default function Purity($$payload) {
 | 
				
			||||
	$$payload.child(($$payload) => {
 | 
				
			||||
	$$payload.push(`<p>0</p> <p>${$.escape(location.href)}</p> `);
 | 
				
			||||
	Child($$payload, { prop: encodeURIComponent('hello') });
 | 
				
			||||
	$$payload.push(`<!---->`);
 | 
				
			||||
	});
 | 
				
			||||
}
 | 
				
			||||
@ -1,9 +1,7 @@
 | 
				
			||||
import * as $ from 'svelte/internal/server';
 | 
				
			||||
 | 
				
			||||
export default function Skip_static_subtree($$payload, $$props) {
 | 
				
			||||
	$$payload.child(($$payload) => {
 | 
				
			||||
	let { title, content } = $$props;
 | 
				
			||||
 | 
				
			||||
	$$payload.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,9 +1,7 @@
 | 
				
			||||
import * as $ from 'svelte/internal/server';
 | 
				
			||||
 | 
				
			||||
export default function Svelte_element($$payload, $$props) {
 | 
				
			||||
	$$payload.child(($$payload) => {
 | 
				
			||||
	let { tag = 'hr' } = $$props;
 | 
				
			||||
 | 
				
			||||
	$.element($$payload, tag);
 | 
				
			||||
	});
 | 
				
			||||
}
 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue