Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
Child.svelte
Child2.svelte
<script>
// -> see: https://github.com/sveltejs/svelte/blob/b6441eb6557e368271d353dbbf8b194d5a315f62/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts#L195-L203
// -> see: https://github.com/sveltejs/svelte/pull/3124
import {onMount, tick} from "svelte"
import Child from "./Child.svelte"
import Child2 from "./Child2.svelte"
// changing hoisted_foo via fn or otherwise will cause updates of Child2 components / slots
// this is a potential performance bottleneck for svelthree.
// probably because of (see JS Output):
/*
---
// when not changing hoisted_foo
if (dirty & /'$$scope'/ 2) {
child2_changes.$$scope = { dirty, ctx };
}
child2.$set(child2_changes);
---

// when changing hoisted_foo
if (dirty & /'$$scope, hoisted_foo/' 3) {
child2_changes.$$scope = { dirty, ctx };
}
child2.$set(child2_changes);
---
*/
const hoisted_foo = {
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */