Skip to main content
App.svelte
Component.svelte
<script>
import Component from "./Component.svelte";
</script>

<Component let:a={b}>
<h1>{b}</h1>
</Component>
/* App.svelte generated by Svelte v4.2.19 */
import {
SvelteComponent,
append,
create_component,
destroy_component,
detach,
element,
init,
insert,
mount_component,
safe_not_equal,
set_data,
text,
transition_in,
transition_out
} from "svelte/internal";

import "svelte/internal/disclose-version";
import Component from "./Component.svelte";

function create_default_slot(ctx) {
let h1;
let t_value = /*b*/ ctx[0] + "";
let t;

return {
c() {
h1 = element("h1");
t = text(t_value);
},
m(target, anchor) {
insert(target, h1, anchor);
append(h1, t);
},
p(ctx, dirty) {
if (dirty & /*b*/ 1 && t_value !== (t_value = /*b*/ ctx[0] + "")) set_data(t, t_value);
},
d(detaching) {
if (detaching) {
detach(h1);
}
}
};
}

function create_fragment(ctx) {
let component;
let current;

component = new Component({
props: {
$$slots: {
default: [create_default_slot, ({ a: b }) => ({ 0: b }), ({ a: b }) => b ? 1 : 0]
},
$$scope: { ctx }
}
});

return {
c() {
create_component(component.$$.fragment);
},
m(target, anchor) {
mount_component(component, target, anchor);
current = true;
},
p(ctx, [dirty]) {
const component_changes = {};

if (dirty & /*$$scope, b*/ 3) {
component_changes.$$scope = { dirty, ctx };
}

component.$set(component_changes);
},
i(local) {
if (current) return;
transition_in(component.$$.fragment, local);
current = true;
},
o(local) {
transition_out(component.$$.fragment, local);
current = false;
},
d(detaching) {
destroy_component(component, detaching);
}
};
}

class App extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
}
}

export default App;
result = svelte.compile(source, {
generate:
css:
});
/* Add a <style> tag to see compiled CSS */
		
			
  • {
    • css: undefined
    • {
      • type: "Script"
      • start: 0
      • end: 63
      • context: "default"
      }
    • module: undefined
    }
The AST is not public API and may change at any point in time