`} />{Node.children.map((child) => ())}`} />)}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata("/projects/app/src/components/RenderNode.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+const $$RenderNode = $$createComponent(($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$RenderNode;
+
+return $$render`${($$render`${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`${$$unescapeHTML(`<${Node.tag} ${stringifyAttributes(Node.attributes)}>`)}`,})}${Node.children.map((child) => ($$render`${$$renderComponent($$result,'Astro.self',Astro.self,{"node":(child)})}`))}${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`${$$unescapeHTML(`${Node.tag}>`)}`,})}`,})}`)}`;
+}, '/projects/app/src/components/RenderNode.astro', undefined);
+export default $$RenderNode;
+```
+---
diff --git a/internal/printer/__snapshots__/complex_table.snap b/internal/printer/__snapshots__/complex_table.snap
new file mode 100755
index 000000000..2ccfb7a3d
--- /dev/null
+++ b/internal/printer/__snapshots__/complex_table.snap
@@ -0,0 +1,131 @@
+
+[TestPrinter/complex_table - 1]
+## Input
+
+```
+
+
+
+
+ Astro Multi Table
+
+
+
+
+ {Array(3).fill(false).map((item, idx) =>
+
+ {'a'}
+
+
+
+ <>{Array(7).fill(false).map((entry, index) => A | )}>
+
+
+
+ |
+
+
+
+
)}
+
+
+
+
+
+
+ B |
+ B |
+ B |
+
+
+
+ |
+
+
+
+
+
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$Component;
+
+return $$render`
+
+
+
+ Astro Multi Table
+ ${$$renderHead($$result)}
+
+
+
+ ${Array(3).fill(false).map((item, idx) => $$render`
+
+ ${'a'}
+
+
+
+ ${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`${Array(7).fill(false).map((entry, index) => $$render`A | `)}`,})}
+
+
+
+ |
+
+
+
+
`)}
+
+
+
+
+
+
+ B |
+ B |
+ B |
+
+
+
+ |
+
+
+
+
+
+
+`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/component.snap b/internal/printer/__snapshots__/component.snap
new file mode 100755
index 000000000..9eca5e784
--- /dev/null
+++ b/internal/printer/__snapshots__/component.snap
@@ -0,0 +1,60 @@
+
+[TestPrinter/component - 1]
+## Input
+
+```
+/-/-/-/
+import VueComponent from '../components/Vue.vue';
+/-/-/-/
+
+
+ Hello world
+
+
+
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import VueComponent from '../components/Vue.vue';
+
+import * as $$module1 from '../components/Vue.vue';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: '../components/Vue.vue', assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`
+
+ Hello world
+ ${$$renderHead($$result)}
+
+ ${$$renderComponent($$result,'VueComponent',VueComponent,{})}
+ `;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/component_in_expression_with_its_child_expression_before_its_child_element.snap b/internal/printer/__snapshots__/component_in_expression_with_its_child_expression_before_its_child_element.snap
new file mode 100755
index 000000000..0818708b8
--- /dev/null
+++ b/internal/printer/__snapshots__/component_in_expression_with_its_child_expression_before_its_child_element.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/component_in_expression_with_its_child_expression_before_its_child_element - 1]
+## Input
+
+```
+{list.map(() => ({name}))}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${list.map(() => ($$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`${name}`,})}`))}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/component_with_only_a_script.snap b/internal/printer/__snapshots__/component_with_only_a_script.snap
new file mode 100755
index 000000000..9209c351e
--- /dev/null
+++ b/internal/printer/__snapshots__/component_with_only_a_script.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/component_with_only_a_script - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [{ type: 'inline', value: `console.log('hello world');` }] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/component_with_quoted_attributes.snap b/internal/printer/__snapshots__/component_with_quoted_attributes.snap
new file mode 100755
index 000000000..30ad56a59
--- /dev/null
+++ b/internal/printer/__snapshots__/component_with_quoted_attributes.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/component_with_quoted_attributes - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{"is":"\"cool\""})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/condition_expressions_at_the_top-level.snap b/internal/printer/__snapshots__/condition_expressions_at_the_top-level.snap
new file mode 100755
index 000000000..dd37e7463
--- /dev/null
+++ b/internal/printer/__snapshots__/condition_expressions_at_the_top-level.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/condition_expressions_at_the_top-level - 1]
+## Input
+
+```
+{cond && }{cond && }
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${cond && $$render`${$$maybeRenderHead($$result)}`}${cond && $$render``}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/condition_expressions_at_the_top-level_with_head_content.snap b/internal/printer/__snapshots__/condition_expressions_at_the_top-level_with_head_content.snap
new file mode 100755
index 000000000..e935fca0a
--- /dev/null
+++ b/internal/printer/__snapshots__/condition_expressions_at_the_top-level_with_head_content.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/condition_expressions_at_the_top-level_with_head_content - 1]
+## Input
+
+```
+{cond && }{cond && My title}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${cond && $$render``}${cond && $$render`My title`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/conditional_iframe.snap b/internal/printer/__snapshots__/conditional_iframe.snap
new file mode 100755
index 000000000..633c11277
--- /dev/null
+++ b/internal/printer/__snapshots__/conditional_iframe.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/conditional_iframe - 1]
+## Input
+
+```
+{bool && }
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${bool && $$render`${$$maybeRenderHead($$result)}`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/conditional_noscript.snap b/internal/printer/__snapshots__/conditional_noscript.snap
new file mode 100755
index 000000000..8a313b772
--- /dev/null
+++ b/internal/printer/__snapshots__/conditional_noscript.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/conditional_noscript - 1]
+## Input
+
+```
+{mode === "production" && }
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${mode === "production" && $$render`${$$maybeRenderHead($$result)}`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/conditional_render.snap b/internal/printer/__snapshots__/conditional_render.snap
new file mode 100755
index 000000000..8fbfb68fe
--- /dev/null
+++ b/internal/printer/__snapshots__/conditional_render.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/conditional_render - 1]
+## Input
+
+```
+{false ? #f
: #t
}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${false ? $$render`#f
` : $$render`#t
`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/conditional_rendering_of_title_containing_expression.snap b/internal/printer/__snapshots__/conditional_rendering_of_title_containing_expression.snap
new file mode 100755
index 000000000..63509cfa5
--- /dev/null
+++ b/internal/printer/__snapshots__/conditional_rendering_of_title_containing_expression.snap
@@ -0,0 +1,57 @@
+
+[TestPrinter/conditional_rendering_of_title_containing_expression - 1]
+## Input
+
+```
+{
+ props.title && (
+ <>
+ {props.title}
+
+
+ >
+ )
+}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${
+ props.title && (
+ $$render`${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`
+ ${props.title}
+
+
+ `,})}`
+ )
+}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/conditional_slot.snap b/internal/printer/__snapshots__/conditional_slot.snap
new file mode 100755
index 000000000..2d863a417
--- /dev/null
+++ b/internal/printer/__snapshots__/conditional_slot.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/conditional_slot - 1]
+## Input
+
+```
+{value && foo
}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"test": () => $$render`${value && $$render`${$$maybeRenderHead($$result)}foo
`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git "a/internal/printer/__snapshots__/css_comment_doesn\342\200\231t_produce_semicolon.snap" "b/internal/printer/__snapshots__/css_comment_doesn\342\200\231t_produce_semicolon.snap"
new file mode 100755
index 000000000..b1af7b64c
--- /dev/null
+++ "b/internal/printer/__snapshots__/css_comment_doesn\342\200\231t_produce_semicolon.snap"
@@ -0,0 +1,44 @@
+
+[TestPrinter/css_comment_doesn’t_produce_semicolon - 1]
+## Input
+
+```
+My Text
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}My Text
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/css_imports_are_not_included_in_module_metadata.snap b/internal/printer/__snapshots__/css_imports_are_not_included_in_module_metadata.snap
new file mode 100755
index 000000000..04f26da00
--- /dev/null
+++ b/internal/printer/__snapshots__/css_imports_are_not_included_in_module_metadata.snap
@@ -0,0 +1,44 @@
+
+[TestPrinter/css_imports_are_not_included_in_module_metadata - 1]
+## Input
+
+```
+/-/-/-/
+ import './styles.css';
+ ---
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import './styles.css';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/custom-element.snap b/internal/printer/__snapshots__/custom-element.snap
new file mode 100755
index 000000000..1aa837bc4
--- /dev/null
+++ b/internal/printer/__snapshots__/custom-element.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/custom-element - 1]
+## Input
+
+```
+{show && }
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${show && $$render`${$$renderComponent($$result,'client-only-element','client-only-element',{})}`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/custom_elements.snap b/internal/printer/__snapshots__/custom_elements.snap
new file mode 100755
index 000000000..794fbbeb3
--- /dev/null
+++ b/internal/printer/__snapshots__/custom_elements.snap
@@ -0,0 +1,47 @@
+
+[TestPrinter/custom_elements - 1]
+## Input
+
+```
+/-/-/-/
+import 'test';
+/-/-/-/
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import 'test';
+
+import * as $$module1 from 'test';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: 'test', assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'my-element','my-element',{})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/define_vars_on_a_module_script_with_imports.snap b/internal/printer/__snapshots__/define_vars_on_a_module_script_with_imports.snap
new file mode 100755
index 000000000..dd9db1a1a
--- /dev/null
+++ b/internal/printer/__snapshots__/define_vars_on_a_module_script_with_imports.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/define:vars_on_a_module_script_with_imports - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/define_vars_on_non-root_elements.snap b/internal/printer/__snapshots__/define_vars_on_non-root_elements.snap
new file mode 100755
index 000000000..0990d8305
--- /dev/null
+++ b/internal/printer/__snapshots__/define_vars_on_non-root_elements.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/define:vars_on_non-root_elements - 1]
+## Input
+
+```
+{true ? foo
: bar
}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const $$definedVars = $$defineStyleVars([{color:'green'}]);
+return $$render`${true ? $$render`${$$maybeRenderHead($$result)}foo
` : $$render`bar
`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/define_vars_on_script_with_StaticExpression_turned_on.snap b/internal/printer/__snapshots__/define_vars_on_script_with_StaticExpression_turned_on.snap
new file mode 100755
index 000000000..88fc47e28
--- /dev/null
+++ b/internal/printer/__snapshots__/define_vars_on_script_with_StaticExpression_turned_on.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/define:vars_on_script_with_StaticExpression_turned_on - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [{ type: 'inline', value: `var two = 'two';` }] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/define_vars_on_style.snap b/internal/printer/__snapshots__/define_vars_on_style.snap
new file mode 100755
index 000000000..738a717a2
--- /dev/null
+++ b/internal/printer/__snapshots__/define_vars_on_style.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/define:vars_on_style - 1]
+## Input
+
+```
+testing
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const $$definedVars = $$defineStyleVars([{color:'green'}]);
+return $$render`${$$maybeRenderHead($$result)}testing
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_empty_attribute_on_element.snap b/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_empty_attribute_on_element.snap
new file mode 100755
index 000000000..218b4e5f2
--- /dev/null
+++ b/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_empty_attribute_on_element.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/define:vars_on_style_tag_with_style_empty_attribute_on_element - 1]
+## Input
+
+```
+testing
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const $$definedVars = $$defineStyleVars([{color:'green'}]);
+return $$render`${$$maybeRenderHead($$result)}testing
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_expression_attribute_on_element.snap b/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_expression_attribute_on_element.snap
new file mode 100755
index 000000000..6b21cbc67
--- /dev/null
+++ b/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_expression_attribute_on_element.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/define:vars_on_style_tag_with_style_expression_attribute_on_element - 1]
+## Input
+
+```
+testing
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const $$definedVars = $$defineStyleVars([{color:'green'}]);
+return $$render`${$$maybeRenderHead($$result)}testing
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_quoted_attribute_on_element.snap b/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_quoted_attribute_on_element.snap
new file mode 100755
index 000000000..c015f3742
--- /dev/null
+++ b/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_quoted_attribute_on_element.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/define:vars_on_style_tag_with_style_quoted_attribute_on_element - 1]
+## Input
+
+```
+testing
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const $$definedVars = $$defineStyleVars([{color:'green'}]);
+return $$render`${$$maybeRenderHead($$result)}testing
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_shorthand_attribute_on_element.snap b/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_shorthand_attribute_on_element.snap
new file mode 100755
index 000000000..aec56ae08
--- /dev/null
+++ b/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_shorthand_attribute_on_element.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/define:vars_on_style_tag_with_style_shorthand_attribute_on_element - 1]
+## Input
+
+```
+testing
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const $$definedVars = $$defineStyleVars([{color:'green'}]);
+return $$render`${$$maybeRenderHead($$result)}testing
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_template_literal_attribute_on_element.snap b/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_template_literal_attribute_on_element.snap
new file mode 100755
index 000000000..6a909777b
--- /dev/null
+++ b/internal/printer/__snapshots__/define_vars_on_style_tag_with_style_template_literal_attribute_on_element.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/define:vars_on_style_tag_with_style_template_literal_attribute_on_element - 1]
+## Input
+
+```
+testing
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const $$definedVars = $$defineStyleVars([{color:'green'}]);
+return $$render`${$$maybeRenderHead($$result)}testing
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/division_inside_expression.snap b/internal/printer/__snapshots__/division_inside_expression.snap
new file mode 100755
index 000000000..c487a3a6e
--- /dev/null
+++ b/internal/printer/__snapshots__/division_inside_expression.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/division_inside_expression - 1]
+## Input
+
+```
+{16 / 4}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${16 / 4}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/doctype.snap b/internal/printer/__snapshots__/doctype.snap
new file mode 100755
index 000000000..18f3251ee
--- /dev/null
+++ b/internal/printer/__snapshots__/doctype.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/doctype - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/dot_component.snap b/internal/printer/__snapshots__/dot_component.snap
new file mode 100755
index 000000000..682318f4a
--- /dev/null
+++ b/internal/printer/__snapshots__/dot_component.snap
@@ -0,0 +1,60 @@
+
+[TestPrinter/dot_component - 1]
+## Input
+
+```
+/-/-/-/
+import * as ns from '../components';
+/-/-/-/
+
+
+ Hello world
+
+
+
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import * as ns from '../components';
+
+import * as $$module1 from '../components';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: '../components', assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`
+
+ Hello world
+ ${$$renderHead($$result)}
+
+ ${$$renderComponent($$result,'ns.Component',ns.Component,{})}
+ `;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/dynamic_import.snap b/internal/printer/__snapshots__/dynamic_import.snap
new file mode 100755
index 000000000..660742d98
--- /dev/null
+++ b/internal/printer/__snapshots__/dynamic_import.snap
@@ -0,0 +1,52 @@
+
+[TestPrinter/dynamic_import - 1]
+## Input
+
+```
+/-/-/-/
+const markdownDocs = await Astro.glob('../markdown/*.md')
+const article2 = await import('../markdown/article2.md')
+/-/-/-/
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+const $$Component = $$createComponent(async ($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$Component;
+
+const markdownDocs = await Astro.glob('../markdown/*.md')
+const article2 = await import('../markdown/article2.md')
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/escaped_entity.snap b/internal/printer/__snapshots__/escaped_entity.snap
new file mode 100755
index 000000000..feb0ec59e
--- /dev/null
+++ b/internal/printer/__snapshots__/escaped_entity.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/escaped_entity - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/export_comments_I.snap b/internal/printer/__snapshots__/export_comments_I.snap
new file mode 100755
index 000000000..fe9dc61e2
--- /dev/null
+++ b/internal/printer/__snapshots__/export_comments_I.snap
@@ -0,0 +1,52 @@
+
+[TestPrinter/export_comments_I - 1]
+## Input
+
+```
+/-/-/-/
+// hmm
+export const foo = 0
+/*
+*/
+/-/-/-/
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+export const foo = 0
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+// hmm
+/*
+*/
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/export_comments_II.snap b/internal/printer/__snapshots__/export_comments_II.snap
new file mode 100755
index 000000000..c25a7f5c1
--- /dev/null
+++ b/internal/printer/__snapshots__/export_comments_II.snap
@@ -0,0 +1,52 @@
+
+[TestPrinter/export_comments_II - 1]
+## Input
+
+```
+/-/-/-/
+// hmm
+export const foo = 0;
+/*
+*/
+/-/-/-/
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+export const foo = 0;
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+// hmm
+
+/*
+*/
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/export_member_does_not_panic.snap b/internal/printer/__snapshots__/export_member_does_not_panic.snap
new file mode 100755
index 000000000..d29211e2f
--- /dev/null
+++ b/internal/printer/__snapshots__/export_member_does_not_panic.snap
@@ -0,0 +1,46 @@
+
+[TestPrinter/export_member_does_not_panic - 1]
+## Input
+
+```
+/-/-/-/
+mod.export();
+/-/-/-/
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+mod.export();
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/expression_returning_multiple_elements.snap b/internal/printer/__snapshots__/expression_returning_multiple_elements.snap
new file mode 100755
index 000000000..536a09632
--- /dev/null
+++ b/internal/printer/__snapshots__/expression_returning_multiple_elements.snap
@@ -0,0 +1,89 @@
+
+[TestPrinter/expression_returning_multiple_elements - 1]
+## Input
+
+```
+
+
+ Welcome to Astro
+ {
+ Object.entries(DUMMY_DATA).map(([dummyKey, dummyValue]) => {
+ return (
+
+ onlyp {dummyKey}
+
+
+ onlyh2 {dummyKey}
+
+
+
div+h2 {dummyKey}
+
+
+
p+h2 {dummyKey}
+
+ );
+ })
+ }
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$Component;
+
+return $$render`${$$renderComponent($$result,'Layout',Layout,{"title":"Welcome to Astro."},{"default": () => $$render`
+ ${$$maybeRenderHead($$result)}
+ Welcome to Astro
+ ${
+ Object.entries(DUMMY_DATA).map(([dummyKey, dummyValue]) => {
+ return (
+ $$render`
+ onlyp ${dummyKey}
+
+
+ onlyh2 ${dummyKey}
+
+
+
div+h2 ${dummyKey}
+
+
+
p+h2 ${dummyKey}
+ `
+ );
+ })
+ }
+
+`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/expression_slot.snap b/internal/printer/__snapshots__/expression_slot.snap
new file mode 100755
index 000000000..1392c83b9
--- /dev/null
+++ b/internal/printer/__snapshots__/expression_slot.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/expression_slot - 1]
+## Input
+
+```
+{true && A
}{false && B
}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"a": () => $$render`${true && $$render`${$$maybeRenderHead($$result)}A
`}`,"b": () => $$render`${false && $$render`B
`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/expression_with_leading_whitespace.snap b/internal/printer/__snapshots__/expression_with_leading_whitespace.snap
new file mode 100755
index 000000000..ebb720984
--- /dev/null
+++ b/internal/printer/__snapshots__/expression_with_leading_whitespace.snap
@@ -0,0 +1,55 @@
+
+[TestPrinter/expression_with_leading_whitespace - 1]
+## Input
+
+```
+
+
+ {
+ - Build: { new Date().toISOString() }
+ - NODE_VERSION: { process.env.NODE_VERSION }
+ }
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}
+
+ ${
+ $$render`- Build: ${ new Date().toISOString() }
+ - NODE_VERSION: ${ process.env.NODE_VERSION }
`
+ }
+
+`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/expressions_with_JS_comments.snap b/internal/printer/__snapshots__/expressions_with_JS_comments.snap
new file mode 100755
index 000000000..d663f5d2c
--- /dev/null
+++ b/internal/printer/__snapshots__/expressions_with_JS_comments.snap
@@ -0,0 +1,62 @@
+
+[TestPrinter/expressions_with_JS_comments - 1]
+## Input
+
+```
+/-/-/-/
+const items = ['red', 'yellow', 'blue'];
+/-/-/-/
+
+ {items.map((item) => (
+ // foo < > < }
+
color
+ ))}
+ {items.map((item) => (
+ /* foo < > < } */
color
+ ))}
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const items = ['red', 'yellow', 'blue'];
+
+return $$render`${$$maybeRenderHead($$result)}
+ ${items.map((item) => (
+ // foo < > < }
+ $$render`
color
`
+ ))}
+ ${items.map((item) => (
+ /* foo < > < } */ $$render`
color
`
+ ))}
+
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/expressions_with_multiple_curly_braces.snap b/internal/printer/__snapshots__/expressions_with_multiple_curly_braces.snap
new file mode 100755
index 000000000..752722b52
--- /dev/null
+++ b/internal/printer/__snapshots__/expressions_with_multiple_curly_braces.snap
@@ -0,0 +1,61 @@
+
+[TestPrinter/expressions_with_multiple_curly_braces - 1]
+## Input
+
+```
+
+{
+ () => {
+ let generate = (input) => {
+ let a = () => { return; };
+ let b = () => { return; };
+ let c = () => { return; };
+ };
+ }
+}
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}
+${
+ () => {
+ let generate = (input) => {
+ let a = () => { return; };
+ let b = () => { return; };
+ let c = () => { return; };
+ };
+ }
+}
+
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/function_expression_slots_I.snap b/internal/printer/__snapshots__/function_expression_slots_I.snap
new file mode 100755
index 000000000..c7fb2c4b2
--- /dev/null
+++ b/internal/printer/__snapshots__/function_expression_slots_I.snap
@@ -0,0 +1,53 @@
+
+[TestPrinter/function_expression_slots_I - 1]
+## Input
+
+```
+
+{() => { switch (value) {
+case 'a': return A
+case 'b': return B
+case 'c': return C
+}
+}}
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},$$mergeSlots({},() => { switch (value) {
+case 'a': return {"a": () => $$render`${$$maybeRenderHead($$result)}A
`}
+case 'b': return {"b": () => $$render`B
`}
+case 'c': return {"c": () => $$render`C
`}
+}
+}))}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/function_expression_slots_II___959_.snap b/internal/printer/__snapshots__/function_expression_slots_II___959_.snap
new file mode 100755
index 000000000..54d22d1c2
--- /dev/null
+++ b/internal/printer/__snapshots__/function_expression_slots_II___959_.snap
@@ -0,0 +1,69 @@
+
+[TestPrinter/function_expression_slots_II_(#959) - 1]
+## Input
+
+```
+
+
+
+ {components.map((component, i) => {
+ switch(component) {
+ case "Hero":
+ return Hero
+ case "Component2":
+ return Component2
+ }
+ })}
+
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$Component;
+
+return $$render`${$$renderComponent($$result,'Layout',Layout,{"title":"Welcome to Astro."},{"default": () => $$render`
+ ${$$maybeRenderHead($$result)}
+ ${$$renderComponent($$result,'Layout',Layout,{"title":"switch bug"},{"default": () => $$render`${components.map((component, i) => {
+ switch(component) {
+ case "Hero":
+ return $$render`Hero
`
+ case "Component2":
+ return $$render`Component2
`
+ }
+ })}`,})}
+
+`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/getStaticPaths__basic_.snap b/internal/printer/__snapshots__/getStaticPaths__basic_.snap
new file mode 100755
index 000000000..8b46fb2e6
--- /dev/null
+++ b/internal/printer/__snapshots__/getStaticPaths__basic_.snap
@@ -0,0 +1,49 @@
+
+[TestPrinter/getStaticPaths_(basic) - 1]
+## Input
+
+```
+/-/-/-/
+export const getStaticPaths = async () => {
+ return { paths: [] }
+}
+/-/-/-/
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+export const getStaticPaths = async () => {
+ return { paths: [] }
+}
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/getStaticPaths__hoisted_.snap b/internal/printer/__snapshots__/getStaticPaths__hoisted_.snap
new file mode 100755
index 000000000..b48a4f2ac
--- /dev/null
+++ b/internal/printer/__snapshots__/getStaticPaths__hoisted_.snap
@@ -0,0 +1,52 @@
+
+[TestPrinter/getStaticPaths_(hoisted) - 1]
+## Input
+
+```
+/-/-/-/
+const a = 0;
+export const getStaticPaths = async () => {
+ return { paths: [] }
+}
+/-/-/-/
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+export const getStaticPaths = async () => {
+ return { paths: [] }
+}
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const a = 0;
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/getStaticPaths__hoisted_II_.snap b/internal/printer/__snapshots__/getStaticPaths__hoisted_II_.snap
new file mode 100755
index 000000000..43859a3bf
--- /dev/null
+++ b/internal/printer/__snapshots__/getStaticPaths__hoisted_II_.snap
@@ -0,0 +1,55 @@
+
+[TestPrinter/getStaticPaths_(hoisted_II) - 1]
+## Input
+
+```
+/-/-/-/
+const a = 0;
+export async function getStaticPaths() {
+ return { paths: [] }
+}
+const b = 0;
+/-/-/-/
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+export async function getStaticPaths() {
+ return { paths: [] }
+}
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const a = 0;
+
+const b = 0;
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/gets_all_potential_hydrated_components.snap b/internal/printer/__snapshots__/gets_all_potential_hydrated_components.snap
new file mode 100755
index 000000000..ca5db5972
--- /dev/null
+++ b/internal/printer/__snapshots__/gets_all_potential_hydrated_components.snap
@@ -0,0 +1,60 @@
+
+[TestPrinter/gets_all_potential_hydrated_components - 1]
+## Input
+
+```
+/-/-/-/
+import One from 'one';
+import Two from 'two';
+import 'custom-element';
+const name = 'world';
+/-/-/-/
+
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import One from 'one';
+import Two from 'two';
+import 'custom-element';
+
+import * as $$module1 from 'one';
+import * as $$module2 from 'two';
+import * as $$module3 from 'custom-element';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: 'one', assert: {} }, { module: $$module2, specifier: 'two', assert: {} }, { module: $$module3, specifier: 'custom-element', assert: {} }], hydratedComponents: ['my-element', Two, One], clientOnlyComponents: [], hydrationDirectives: new Set(['load']), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const name = 'world';
+
+return $$render`${$$renderComponent($$result,'One',One,{"client:load":true,"client:component-hydration":"load","client:component-path":("one"),"client:component-export":("default")})}
+${$$renderComponent($$result,'Two',Two,{"client:load":true,"client:component-hydration":"load","client:component-path":("two"),"client:component-export":("default")})}
+${$$renderComponent($$result,'my-element','my-element',{"client:load":true,"client:component-hydration":"load"})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/head_expression.snap b/internal/printer/__snapshots__/head_expression.snap
new file mode 100755
index 000000000..93092dca0
--- /dev/null
+++ b/internal/printer/__snapshots__/head_expression.snap
@@ -0,0 +1,59 @@
+
+[TestPrinter/head_expression - 1]
+## Input
+
+```
+/-/-/-/
+const name = "world";
+/-/-/-/
+
+
+ Hello {name}
+
+
+
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const name = "world";
+
+return $$render`
+
+ Hello ${name}
+ ${$$renderHead($$result)}
+
+
+ `;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/head_expression_and_conditional_rendering_of_fragment.snap b/internal/printer/__snapshots__/head_expression_and_conditional_rendering_of_fragment.snap
new file mode 100755
index 000000000..cbfdeead2
--- /dev/null
+++ b/internal/printer/__snapshots__/head_expression_and_conditional_rendering_of_fragment.snap
@@ -0,0 +1,63 @@
+
+[TestPrinter/head_expression_and_conditional_rendering_of_fragment - 1]
+## Input
+
+```
+/-/-/-/
+const testBool = true;
+/-/-/-/
+
+
+
+ {testBool ? "Hey" : "Bye"}
+ {testBool && (<>>)}
+
+
+
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const testBool = true;
+
+return $$render`
+
+
+ ${testBool ? "Hey" : "Bye"}
+ ${testBool && ($$render`${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render``,})}`)}
+ ${$$renderHead($$result)}
+
+
+ `;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/head_inside_slot.snap b/internal/printer/__snapshots__/head_inside_slot.snap
new file mode 100755
index 000000000..83fe49596
--- /dev/null
+++ b/internal/printer/__snapshots__/head_inside_slot.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/head_inside_slot - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderSlot($$result,$$slots["default"],$$render`${$$renderHead($$result)}`)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/head_slot.snap b/internal/printer/__snapshots__/head_slot.snap
new file mode 100755
index 000000000..3c647e576
--- /dev/null
+++ b/internal/printer/__snapshots__/head_slot.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/head_slot - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderSlot($$result,$$slots["default"])}${$$renderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/head_slot_II.snap b/internal/printer/__snapshots__/head_slot_II.snap
new file mode 100755
index 000000000..e34674c30
--- /dev/null
+++ b/internal/printer/__snapshots__/head_slot_II.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/head_slot_II - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderSlot($$result,$$slots["default"])}${$$renderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/head_slot_III.snap b/internal/printer/__snapshots__/head_slot_III.snap
new file mode 100755
index 000000000..ba21336d5
--- /dev/null
+++ b/internal/printer/__snapshots__/head_slot_III.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/head_slot_III - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderSlot($$result,$$slots["baseHeadExtension"],$$render``)}${$$renderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/html5_boilerplate.snap b/internal/printer/__snapshots__/html5_boilerplate.snap
new file mode 100755
index 000000000..d17075fda
--- /dev/null
+++ b/internal/printer/__snapshots__/html5_boilerplate.snap
@@ -0,0 +1,97 @@
+
+[TestPrinter/html5_boilerplate - 1]
+## Input
+
+```
+
+
+
+
+
+
+
+ A Basic HTML5 Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`
+
+
+
+
+ A Basic HTML5 Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+${$$renderHead($$result)}
+
+
+
+
+
+`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/iframe.snap b/internal/printer/__snapshots__/iframe.snap
new file mode 100755
index 000000000..c08306a64
--- /dev/null
+++ b/internal/printer/__snapshots__/iframe.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/iframe - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/import.meta.env.snap b/internal/printer/__snapshots__/import.meta.env.snap
new file mode 100755
index 000000000..a2bdb6686
--- /dev/null
+++ b/internal/printer/__snapshots__/import.meta.env.snap
@@ -0,0 +1,129 @@
+
+[TestPrinter/import.meta.env - 1]
+## Input
+
+```
+/-/-/-/
+import Header from '../../components/Header.jsx'
+import Footer from '../../components/Footer.astro'
+import ProductPageContent from '../../components/ProductPageContent.jsx';
+
+export async function getStaticPaths() {
+ let products = await fetch(`${import.meta.env.PUBLIC_NETLIFY_URL}/.netlify/functions/get-product-list`)
+ .then(res => res.json()).then((response) => {
+ console.log('--- built product pages ---')
+ return response.products.edges
+ });
+
+ return products.map((p, i) => {
+ return {
+ params: {pid: p.node.handle},
+ props: {product: p},
+ };
+ });
+}
+
+const { product } = Astro.props;
+/-/-/-/
+
+
+
+
+
+
+ Shoperoni | Buy {product.node.title}
+
+
+
+
+
+
+
+
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import Header from '../../components/Header.jsx'
+
+import Footer from '../../components/Footer.astro'
+
+import ProductPageContent from '../../components/ProductPageContent.jsx';
+
+import * as $$module1 from '../../components/Header.jsx';
+import * as $$module2 from '../../components/Footer.astro';
+import * as $$module3 from '../../components/ProductPageContent.jsx';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: '../../components/Header.jsx', assert: {} }, { module: $$module2, specifier: '../../components/Footer.astro', assert: {} }, { module: $$module3, specifier: '../../components/ProductPageContent.jsx', assert: {} }], hydratedComponents: [ProductPageContent], clientOnlyComponents: [], hydrationDirectives: new Set(['visible']), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+export async function getStaticPaths() {
+ let products = await fetch(`${import.meta.env.PUBLIC_NETLIFY_URL}/.netlify/functions/get-product-list`)
+ .then(res => res.json()).then((response) => {
+ console.log('--- built product pages ---')
+ return response.products.edges
+ });
+
+ return products.map((p, i) => {
+ return {
+ params: {pid: p.node.handle},
+ props: {product: p},
+ };
+ });
+}
+const $$Component = $$createComponent(async ($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$Component;
+
+const { product } = Astro.props;
+
+return $$render`
+
+
+
+ Shoperoni | Buy ${product.node.title}
+
+
+
+${$$renderHead($$result)}
+
+ ${$$renderComponent($$result,'Header',Header,{})}
+
+
+ ${$$renderComponent($$result,'ProductPageContent',ProductPageContent,{"client:visible":true,"product":(product.node),"client:component-hydration":"visible","client:component-path":("../../components/ProductPageContent.jsx"),"client:component-export":("default")})}
+
+
+ ${$$renderComponent($$result,'Footer',Footer,{})}
+`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/import.meta.snap b/internal/printer/__snapshots__/import.meta.snap
new file mode 100755
index 000000000..93f096a84
--- /dev/null
+++ b/internal/printer/__snapshots__/import.meta.snap
@@ -0,0 +1,49 @@
+
+[TestPrinter/import.meta - 1]
+## Input
+
+```
+/-/-/-/
+const components = import.meta.glob("../components/*.astro", {
+ import: 'default'
+});
+/-/-/-/
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const components = import.meta.glob("../components/*.astro", {
+ import: 'default'
+});
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/import_assertions.snap b/internal/printer/__snapshots__/import_assertions.snap
new file mode 100755
index 000000000..b68650646
--- /dev/null
+++ b/internal/printer/__snapshots__/import_assertions.snap
@@ -0,0 +1,46 @@
+
+[TestPrinter/import_assertions - 1]
+## Input
+
+```
+/-/-/-/
+import data from "test" assert { type: 'json' };
+/-/-/-/
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import data from "test" assert { type: 'json' };
+
+import * as $$module1 from 'test' assert {type:'json'};
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: 'test', assert: {type:'json'} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/import_order.snap b/internal/printer/__snapshots__/import_order.snap
new file mode 100755
index 000000000..6c2f452e2
--- /dev/null
+++ b/internal/printer/__snapshots__/import_order.snap
@@ -0,0 +1,53 @@
+
+[TestPrinter/import_order - 1]
+## Input
+
+```
+/-/-/-/
+let testWord = "Test"
+// comment
+import data from "test";
+/-/-/-/
+
+{data}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import data from "test";
+
+import * as $$module1 from 'test';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: 'test', assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+let testWord = "Test"
+// comment
+
+return $$render`${$$maybeRenderHead($$result)}${data}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/import_to_identifier_named_assert.snap b/internal/printer/__snapshots__/import_to_identifier_named_assert.snap
new file mode 100755
index 000000000..1d6f469d7
--- /dev/null
+++ b/internal/printer/__snapshots__/import_to_identifier_named_assert.snap
@@ -0,0 +1,46 @@
+
+[TestPrinter/import_to_identifier_named_assert - 1]
+## Input
+
+```
+/-/-/-/
+import assert from 'test';
+/-/-/-/
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import assert from 'test';
+
+import * as $$module1 from 'test';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: 'test', assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/includes_comments_for_expression_attribute.snap b/internal/printer/__snapshots__/includes_comments_for_expression_attribute.snap
new file mode 100755
index 000000000..14dcc8a78
--- /dev/null
+++ b/internal/printer/__snapshots__/includes_comments_for_expression_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/includes_comments_for_expression_attribute - 1]
+## Input
+
+```
+Hello
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}Hello
${$$renderComponent($$result,'Component',Component,{"attr":(/* comment 1 */ isTrue ? 1 : 2 /* comment 2 */)})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/includes_comments_for_shorthand_attribute.snap b/internal/printer/__snapshots__/includes_comments_for_shorthand_attribute.snap
new file mode 100755
index 000000000..4bb9c1fa3
--- /dev/null
+++ b/internal/printer/__snapshots__/includes_comments_for_shorthand_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/includes_comments_for_shorthand_attribute - 1]
+## Input
+
+```
+Hello
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}Hello
${$$renderComponent($$result,'Component',Component,{"id":(/* comment 1 */ id /* comment 2 */)})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/is_raw.snap b/internal/printer/__snapshots__/is_raw.snap
new file mode 100755
index 000000000..833e8c100
--- /dev/null
+++ b/internal/printer/__snapshots__/is_raw.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/is:raw - 1]
+## Input
+
+```
+<% awesome %>
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}<% awesome %>`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/map_basic.snap b/internal/printer/__snapshots__/map_basic.snap
new file mode 100755
index 000000000..2f81166f6
--- /dev/null
+++ b/internal/printer/__snapshots__/map_basic.snap
@@ -0,0 +1,54 @@
+
+[TestPrinter/map_basic - 1]
+## Input
+
+```
+/-/-/-/
+const items = [0, 1, 2];
+/-/-/-/
+
+ {items.map(item => {
+ return - {item}
;
+ })}
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const items = [0, 1, 2];
+
+return $$render`${$$maybeRenderHead($$result)}
+ ${items.map(item => {
+ return $$render`- ${item}
`;
+ })}
+
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/map_nested.snap b/internal/printer/__snapshots__/map_nested.snap
new file mode 100755
index 000000000..8c218e7a7
--- /dev/null
+++ b/internal/printer/__snapshots__/map_nested.snap
@@ -0,0 +1,62 @@
+
+[TestPrinter/map_nested - 1]
+## Input
+
+```
+/-/-/-/
+const groups = [[0, 1, 2], [3, 4, 5]];
+/-/-/-/
+
+ {groups.map(items => {
+ return
{
+ items.map(item => {
+ return - {item}
;
+ })
+ }
+ })}
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const groups = [[0, 1, 2], [3, 4, 5]];
+
+return $$render`${$$maybeRenderHead($$result)}
+ ${groups.map(items => {
+ return $$render`
${
+ items.map(item => {
+ return $$render`- ${item}
`;
+ })
+ }
`
+ })}
+
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/map_with_component.snap b/internal/printer/__snapshots__/map_with_component.snap
new file mode 100755
index 000000000..160a073a8
--- /dev/null
+++ b/internal/printer/__snapshots__/map_with_component.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/map_with_component - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderComponent($$result,'Hello',Hello,{})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/map_without_component.snap b/internal/printer/__snapshots__/map_without_component.snap
new file mode 100755
index 000000000..103e4e91e
--- /dev/null
+++ b/internal/printer/__snapshots__/map_without_component.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/map_without_component - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/maybeRenderHead_not_printed_for_hoisted_scripts.snap b/internal/printer/__snapshots__/maybeRenderHead_not_printed_for_hoisted_scripts.snap
new file mode 100755
index 000000000..a640a1749
--- /dev/null
+++ b/internal/printer/__snapshots__/maybeRenderHead_not_printed_for_hoisted_scripts.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/maybeRenderHead_not_printed_for_hoisted_scripts - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata("/projects/app/src/pages/page.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Page = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Layout',Layout,{})}`;
+}, '/projects/app/src/pages/page.astro', undefined);
+export default $$Page;
+```
+---
diff --git a/internal/printer/__snapshots__/multibyte_character_+_script.snap b/internal/printer/__snapshots__/multibyte_character_+_script.snap
new file mode 100755
index 000000000..a74ff64f2
--- /dev/null
+++ b/internal/printer/__snapshots__/multibyte_character_+_script.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/multibyte_character_+_script - 1]
+## Input
+
+```
+ツ
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [{ type: 'inline', value: `console.log('foo')` }] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}ツ`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/multibyte_character_+_style.snap b/internal/printer/__snapshots__/multibyte_character_+_style.snap
new file mode 100755
index 000000000..90c2c0803
--- /dev/null
+++ b/internal/printer/__snapshots__/multibyte_character_+_style.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/multibyte_character_+_style - 1]
+## Input
+
+```
+ツ
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}ツ`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/multibyte_characters.snap b/internal/printer/__snapshots__/multibyte_characters.snap
new file mode 100755
index 000000000..49276e507
--- /dev/null
+++ b/internal/printer/__snapshots__/multibyte_characters.snap
@@ -0,0 +1,43 @@
+
+[TestPrinter/multibyte_characters - 1]
+## Input
+
+```
+/-/-/-/
+/-/-/-/
+こんにちは
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}こんにちは
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/multiple_define_vars_on_style.snap b/internal/printer/__snapshots__/multiple_define_vars_on_style.snap
new file mode 100755
index 000000000..0c082c436
--- /dev/null
+++ b/internal/printer/__snapshots__/multiple_define_vars_on_style.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/multiple_define:vars_on_style - 1]
+## Input
+
+```
+foo
bar
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const $$definedVars = $$defineStyleVars([{color:'red'},{color:'green'}]);
+return $$render`${$$maybeRenderHead($$result)}foo
bar
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/nested_expressions.snap b/internal/printer/__snapshots__/nested_expressions.snap
new file mode 100755
index 000000000..209aef555
--- /dev/null
+++ b/internal/printer/__snapshots__/nested_expressions.snap
@@ -0,0 +1,45 @@
+
+[TestPrinter/nested_expressions - 1]
+## Input
+
+```
+{(previous || next) && }
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$Component;
+
+return $$render`${$$maybeRenderHead($$result)}${(previous || next) && $$render``}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/nested_expressions_II.snap b/internal/printer/__snapshots__/nested_expressions_II.snap
new file mode 100755
index 000000000..e59e39aa1
--- /dev/null
+++ b/internal/printer/__snapshots__/nested_expressions_II.snap
@@ -0,0 +1,45 @@
+
+[TestPrinter/nested_expressions_II - 1]
+## Input
+
+```
+{(previous || next) && }
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$Component;
+
+return $$render`${$$maybeRenderHead($$result)}${(previous || next) && $$render``}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/nested_expressions_III.snap b/internal/printer/__snapshots__/nested_expressions_III.snap
new file mode 100755
index 000000000..2cffc9fac
--- /dev/null
+++ b/internal/printer/__snapshots__/nested_expressions_III.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/nested_expressions_III - 1]
+## Input
+
+```
+{x.map((x) => x ?
{true ? {x} : null}
:
{false ? null : {x}}
)}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${x.map((x) => x ? $$render`
${true ? $$render`${x}` : null}
` : $$render`
${false ? null : $$render`${x}`}
`)}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/nested_expressions_IV.snap b/internal/printer/__snapshots__/nested_expressions_IV.snap
new file mode 100755
index 000000000..1989856ae
--- /dev/null
+++ b/internal/printer/__snapshots__/nested_expressions_IV.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/nested_expressions_IV - 1]
+## Input
+
+```
+{() => { if (value > 0.25) { return Default } else if (value > 0.5) { return Another } else if (value > 0.75) { return Other } return Yet Other }}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${() => { if (value > 0.25) { return $$render`Default` } else if (value > 0.5) { return $$render`Another` } else if (value > 0.75) { return $$render`Other` } return $$render`Yet Other` }}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/nested_expressions_V.snap b/internal/printer/__snapshots__/nested_expressions_V.snap
new file mode 100755
index 000000000..29d2d8afa
--- /dev/null
+++ b/internal/printer/__snapshots__/nested_expressions_V.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/nested_expressions_V - 1]
+## Input
+
+```
+title
{list.map(group => {group.label}
{group.items.map(item => {item})})}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}title
${list.map(group => $$render`${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`${group.label}
${group.items.map(item => $$render`${item}`)}`,})}`)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/nested_expressions_VI.snap b/internal/printer/__snapshots__/nested_expressions_VI.snap
new file mode 100755
index 000000000..95129dcaa
--- /dev/null
+++ b/internal/printer/__snapshots__/nested_expressions_VI.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/nested_expressions_VI - 1]
+## Input
+
+```
+{()=>{ if (true) { return
;} if (true) { return
;}}}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${()=>{ if (true) { return $$render`
`;} if (true) { return $$render`
`;}}}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/nested_expressions_VII.snap b/internal/printer/__snapshots__/nested_expressions_VII.snap
new file mode 100755
index 000000000..d09be0625
--- /dev/null
+++ b/internal/printer/__snapshots__/nested_expressions_VII.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/nested_expressions_VII - 1]
+## Input
+
+```
+{() => { if (value > 0.25) { return
;} else if (value > 0.5) { return
;} else if (value > 0.75) { return
;} return
Yaaay
;}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${() => { if (value > 0.25) { return $$render`
`;} else if (value > 0.5) { return $$render`
`;} else if (value > 0.75) { return $$render`
`;} return $$render`
Yaaay
`;}}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/nested_expressions_VIII.snap b/internal/printer/__snapshots__/nested_expressions_VIII.snap
new file mode 100755
index 000000000..2d25a8017
--- /dev/null
+++ b/internal/printer/__snapshots__/nested_expressions_VIII.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/nested_expressions_VIII - 1]
+## Input
+
+```
+{ items.map(({ type, ...data }) => { switch (type) { case 'card': { return (
); } case 'paragraph': { return (
{data.body}
);}}})}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${ items.map(({ type, ...data }) => { switch (type) { case 'card': { return ( $$render`${$$renderComponent($$result,'Card',Card,{...(data)})}` ); } case 'paragraph': { return ( $$render`
${data.body}
`);}}})}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/nested_head_content_stays_in_the_head.snap b/internal/printer/__snapshots__/nested_head_content_stays_in_the_head.snap
new file mode 100755
index 000000000..fcca634f6
--- /dev/null
+++ b/internal/printer/__snapshots__/nested_head_content_stays_in_the_head.snap
@@ -0,0 +1,72 @@
+
+[TestPrinter/nested_head_content_stays_in_the_head - 1]
+## Input
+
+```
+/-/-/-/
+const meta = { title: 'My App' };
+/-/-/-/
+
+
+
+
+
+ {
+ meta && {meta.title}
+ }
+
+
+
+
+ My App
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const meta = { title: 'My App' };
+
+return $$render`
+
+
+
+ ${
+ meta && $$render`${meta.title}`
+ }
+
+
+ ${$$renderHead($$result)}
+
+ My App
+ `;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/nested_template_literal_expression.snap b/internal/printer/__snapshots__/nested_template_literal_expression.snap
new file mode 100755
index 000000000..246c6db7b
--- /dev/null
+++ b/internal/printer/__snapshots__/nested_template_literal_expression.snap
@@ -0,0 +1,91 @@
+
+[TestPrinter/nested_template_literal_expression - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
+
+[TestPrinter/nested_template_literal_expression#01 - 1]
+## Input
+
+```
+
+
+{Object.keys(importedAuthors).map(author => hello
)}
+{Object.keys(importedAuthors).map(author => {author}
)}
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`
+${$$maybeRenderHead($$result)}
+${Object.keys(importedAuthors).map(author => $$render`hello
`)}
+${Object.keys(importedAuthors).map(author => $$render`${author}
`)}
+`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/no_expressions_in_math.snap b/internal/printer/__snapshots__/no_expressions_in_math.snap
new file mode 100755
index 000000000..7f1a4c5d3
--- /dev/null
+++ b/internal/printer/__snapshots__/no_expressions_in_math.snap
@@ -0,0 +1,82 @@
+
+[TestPrinter/no_expressions_in_math - 1]
+## Input
+
+```
+Hello, world! This is a buggy formula: f:X→R2x
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}Hello, world! This is a buggy formula: f:X→R2x
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
+
+[TestPrinter/no_expressions_in_math#01 - 1]
+## Input
+
+```
+Hello, world! This is a buggy formula: f:X→R2x
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}Hello, world! This is a buggy formula: f:X→R2x
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/noscript_component.snap b/internal/printer/__snapshots__/noscript_component.snap
new file mode 100755
index 000000000..5dea0d880
--- /dev/null
+++ b/internal/printer/__snapshots__/noscript_component.snap
@@ -0,0 +1,54 @@
+
+[TestPrinter/noscript_component - 1]
+## Input
+
+```
+
+
+
+
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`
+ ${$$renderHead($$result)}
+
+
+ `;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/noscript_deep_styles.snap b/internal/printer/__snapshots__/noscript_deep_styles.snap
new file mode 100755
index 000000000..065adac17
--- /dev/null
+++ b/internal/printer/__snapshots__/noscript_deep_styles.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/noscript_deep_styles - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/noscript_only.snap b/internal/printer/__snapshots__/noscript_only.snap
new file mode 100755
index 000000000..65811d3af
--- /dev/null
+++ b/internal/printer/__snapshots__/noscript_only.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/noscript_only - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/noscript_styles.snap b/internal/printer/__snapshots__/noscript_styles.snap
new file mode 100755
index 000000000..442c16dde
--- /dev/null
+++ b/internal/printer/__snapshots__/noscript_styles.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/noscript_styles - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/orphan_slot.snap b/internal/printer/__snapshots__/orphan_slot.snap
new file mode 100755
index 000000000..4a0718491
--- /dev/null
+++ b/internal/printer/__snapshots__/orphan_slot.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/orphan_slot - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderSlot($$result,$$slots["default"])}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/passes_escaped_filename_into_createComponent_if_it_contains_single_quotes.snap b/internal/printer/__snapshots__/passes_escaped_filename_into_createComponent_if_it_contains_single_quotes.snap
new file mode 100755
index 000000000..d9285beae
--- /dev/null
+++ b/internal/printer/__snapshots__/passes_escaped_filename_into_createComponent_if_it_contains_single_quotes.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/passes_escaped_filename_into_createComponent_if_it_contains_single_quotes - 1]
+## Input
+
+```
+test
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata("/projects/app/src/pages/page-with-\'-quotes.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$PageWithQuotes = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}test
`;
+}, '/projects/app/src/pages/page-with-\'-quotes.astro', undefined);
+export default $$PageWithQuotes;
+```
+---
diff --git a/internal/printer/__snapshots__/passes_filename_into_createComponent_if_passed_into_the_compiler_options.snap b/internal/printer/__snapshots__/passes_filename_into_createComponent_if_passed_into_the_compiler_options.snap
new file mode 100755
index 000000000..febb9aaf7
--- /dev/null
+++ b/internal/printer/__snapshots__/passes_filename_into_createComponent_if_passed_into_the_compiler_options.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/passes_filename_into_createComponent_if_passed_into_the_compiler_options - 1]
+## Input
+
+```
+test
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata("/projects/app/src/pages/page.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Page = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}test
`;
+}, '/projects/app/src/pages/page.astro', undefined);
+export default $$Page;
+```
+---
diff --git a/internal/printer/__snapshots__/preserve_is_inline_slot.snap b/internal/printer/__snapshots__/preserve_is_inline_slot.snap
new file mode 100755
index 000000000..b48c19984
--- /dev/null
+++ b/internal/printer/__snapshots__/preserve_is_inline_slot.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/preserve_is:inline_slot - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/preserve_is_inline_slot_II.snap b/internal/printer/__snapshots__/preserve_is_inline_slot_II.snap
new file mode 100755
index 000000000..f05573ce5
--- /dev/null
+++ b/internal/printer/__snapshots__/preserve_is_inline_slot_II.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/preserve_is:inline_slot_II - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/script__renderScript__true_.snap b/internal/printer/__snapshots__/script__renderScript__true_.snap
new file mode 100755
index 000000000..e9fee4c87
--- /dev/null
+++ b/internal/printer/__snapshots__/script__renderScript__true_.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/script_(renderScript:_true) - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata("/src/pages/index.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [{ type: 'inline', value: `console.log("Hello");` }] });
+
+const $$Index = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderScript($$result,"/src/pages/index.astro?astro&type=script&index=0&lang.ts")}`;
+}, '/src/pages/index.astro', undefined);
+export default $$Index;
+```
+---
diff --git a/internal/printer/__snapshots__/script_before_elements.snap b/internal/printer/__snapshots__/script_before_elements.snap
new file mode 100755
index 000000000..f1fbc30a3
--- /dev/null
+++ b/internal/printer/__snapshots__/script_before_elements.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/script_before_elements - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [{ type: 'inline', value: `Here` }] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/script_define_vars_I.snap b/internal/printer/__snapshots__/script_define_vars_I.snap
new file mode 100755
index 000000000..36066a224
--- /dev/null
+++ b/internal/printer/__snapshots__/script_define_vars_I.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/script_define:vars_I - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/script_define_vars_II.snap b/internal/printer/__snapshots__/script_define_vars_II.snap
new file mode 100755
index 000000000..0ac6b79eb
--- /dev/null
+++ b/internal/printer/__snapshots__/script_define_vars_II.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/script_define:vars_II - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/script_external__renderScript__true_.snap b/internal/printer/__snapshots__/script_external__renderScript__true_.snap
new file mode 100755
index 000000000..88be65653
--- /dev/null
+++ b/internal/printer/__snapshots__/script_external__renderScript__true_.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/script_external_(renderScript:_true) - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata("/src/pages/index.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [{ type: 'external', src: './hello.js' }] });
+
+const $$Index = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderScript($$result,"/src/pages/index.astro?astro&type=script&index=0&lang.ts")}`;
+}, '/src/pages/index.astro', undefined);
+export default $$Index;
+```
+---
diff --git a/internal/printer/__snapshots__/script_hoist_with_frontmatter.snap b/internal/printer/__snapshots__/script_hoist_with_frontmatter.snap
new file mode 100755
index 000000000..6cbde7c78
--- /dev/null
+++ b/internal/printer/__snapshots__/script_hoist_with_frontmatter.snap
@@ -0,0 +1,43 @@
+
+[TestPrinter/script_hoist_with_frontmatter - 1]
+## Input
+
+```
+/-/-/-/
+/-/-/-/
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [{ type: 'inline', value: `console.log("Hello");` }] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/script_hoist_without_frontmatter.snap b/internal/printer/__snapshots__/script_hoist_without_frontmatter.snap
new file mode 100755
index 000000000..7abf3adc4
--- /dev/null
+++ b/internal/printer/__snapshots__/script_hoist_without_frontmatter.snap
@@ -0,0 +1,44 @@
+
+[TestPrinter/script_hoist_without_frontmatter - 1]
+## Input
+
+```
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [{ type: 'inline', value: `console.log("Hello");` }] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}
+
+`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/script_in__head_.snap b/internal/printer/__snapshots__/script_in__head_.snap
new file mode 100755
index 000000000..90ceaa62b
--- /dev/null
+++ b/internal/printer/__snapshots__/script_in__head_.snap
@@ -0,0 +1,56 @@
+
+[TestPrinter/script_in_ - 1]
+## Input
+
+```
+/-/-/-/
+import Widget from '../components/Widget.astro';
+import Widget2 from '../components/Widget2.astro';
+/-/-/-/
+
+
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import Widget from '../components/Widget.astro';
+import Widget2 from '../components/Widget2.astro';
+
+import * as $$module1 from '../components/Widget.astro';
+import * as $$module2 from '../components/Widget2.astro';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: '../components/Widget.astro', assert: {} }, { module: $$module2, specifier: '../components/Widget2.astro', assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`
+
+
+ ${$$renderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/script_inline.snap b/internal/printer/__snapshots__/script_inline.snap
new file mode 100755
index 000000000..6257ebe1e
--- /dev/null
+++ b/internal/printer/__snapshots__/script_inline.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/script_inline - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/script_inline__renderScript__true_.snap b/internal/printer/__snapshots__/script_inline__renderScript__true_.snap
new file mode 100755
index 000000000..b32089fc8
--- /dev/null
+++ b/internal/printer/__snapshots__/script_inline__renderScript__true_.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/script_inline_(renderScript:_true) - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/script_mixed_handled_and_inline__renderScript__true_.snap b/internal/printer/__snapshots__/script_mixed_handled_and_inline__renderScript__true_.snap
new file mode 100755
index 000000000..87d237a04
--- /dev/null
+++ b/internal/printer/__snapshots__/script_mixed_handled_and_inline__renderScript__true_.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/script_mixed_handled_and_inline_(renderScript:_true) - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata("/src/pages/index.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [{ type: 'inline', value: `console.log("Hello");` }] });
+
+const $$Index = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderScript($$result,"/src/pages/index.astro?astro&type=script&index=0&lang.ts")}`;
+}, '/src/pages/index.astro', undefined);
+export default $$Index;
+```
+---
diff --git a/internal/printer/__snapshots__/script_multiple__renderScript__true_.snap b/internal/printer/__snapshots__/script_multiple__renderScript__true_.snap
new file mode 100755
index 000000000..12b257be5
--- /dev/null
+++ b/internal/printer/__snapshots__/script_multiple__renderScript__true_.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/script_multiple_(renderScript:_true) - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata("/src/pages/index.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [{ type: 'inline', value: `console.log("World");` }, { type: 'inline', value: `console.log("Hello");` }] });
+
+const $$Index = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderScript($$result,"/src/pages/index.astro?astro&type=script&index=0&lang.ts")}${$$renderScript($$result,"/src/pages/index.astro?astro&type=script&index=1&lang.ts")}`;
+}, '/src/pages/index.astro', undefined);
+export default $$Index;
+```
+---
diff --git a/internal/printer/__snapshots__/select_in_form.snap b/internal/printer/__snapshots__/select_in_form.snap
new file mode 100755
index 000000000..0c1ab1c32
--- /dev/null
+++ b/internal/printer/__snapshots__/select_in_form.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/select_in_form - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/select_map_expression.snap b/internal/printer/__snapshots__/select_map_expression.snap
new file mode 100755
index 000000000..d34377c1d
--- /dev/null
+++ b/internal/printer/__snapshots__/select_map_expression.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/select_map_expression - 1]
+## Input
+
+```
+Hello world!
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}Hello world!
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/select_nested_option.snap b/internal/printer/__snapshots__/select_nested_option.snap
new file mode 100755
index 000000000..4377b2884
--- /dev/null
+++ b/internal/printer/__snapshots__/select_nested_option.snap
@@ -0,0 +1,46 @@
+
+[TestPrinter/select_nested_option - 1]
+## Input
+
+```
+/-/-/-/
+const value = 'test';
+/-/-/-/
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const value = 'test';
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/select_option_expression.snap b/internal/printer/__snapshots__/select_option_expression.snap
new file mode 100755
index 000000000..b6f007bb5
--- /dev/null
+++ b/internal/printer/__snapshots__/select_option_expression.snap
@@ -0,0 +1,46 @@
+
+[TestPrinter/select_option_expression - 1]
+## Input
+
+```
+/-/-/-/
+const value = 'test';
+/-/-/-/
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const value = 'test';
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/self-closing_td.snap b/internal/printer/__snapshots__/self-closing_td.snap
new file mode 100755
index 000000000..265ab3f77
--- /dev/null
+++ b/internal/printer/__snapshots__/self-closing_td.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/self-closing_td - 1]
+## Input
+
+```
+{data.map(row => {row.map(cell => | )}
)}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${data.map(row => $$render`${row.map(cell => $$render`${$$unescapeHTML(cell)} | `)}
`)}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html.snap b/internal/printer/__snapshots__/set_html.snap
new file mode 100755
index 000000000..ce64cebae
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$unescapeHTML(content)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_and_set_text.snap b/internal/printer/__snapshots__/set_html_and_set_text.snap
new file mode 100755
index 000000000..aee1a4e9f
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_and_set_text.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_and_set:text - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$unescapeHTML(content)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_Component.snap b/internal/printer/__snapshots__/set_html_on_Component.snap
new file mode 100755
index 000000000..319d943b1
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_Component.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_Component - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`${$$unescapeHTML(content)}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_Component_with_quoted_attribute.snap b/internal/printer/__snapshots__/set_html_on_Component_with_quoted_attribute.snap
new file mode 100755
index 000000000..4a60e9775
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_Component_with_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_Component_with_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`${"content"}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_Component_with_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_html_on_Component_with_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..300ac11e9
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_Component_with_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_Component_with_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`${`${content}`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_Component_with_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_html_on_Component_with_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..e5e121ae6
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_Component_with_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_Component_with_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`${`content`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_Fragment.snap b/internal/printer/__snapshots__/set_html_on_Fragment.snap
new file mode 100755
index 000000000..4c5b66ee0
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_Fragment.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_Fragment - 1]
+## Input
+
+```
+<i>This should NOT be italic</i>"} />
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`${$$unescapeHTML("<i>This should NOT be italic</i>
")}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_Fragment_with_quoted_attribute.snap b/internal/printer/__snapshots__/set_html_on_Fragment_with_quoted_attribute.snap
new file mode 100755
index 000000000..31bd82825
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_Fragment_with_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_Fragment_with_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`${"This should NOT be italic
"}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_Fragment_with_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_html_on_Fragment_with_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..99bb11d27
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_Fragment_with_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_Fragment_with_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`${`${content}`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_Fragment_with_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_html_on_Fragment_with_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..0a9abd742
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_Fragment_with_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_Fragment_with_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+<i>This should NOT be italic</i>` />
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`${`This should NOT be italic
`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_custom-element.snap b/internal/printer/__snapshots__/set_html_on_custom-element.snap
new file mode 100755
index 000000000..adcd889ff
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_custom-element.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_custom-element - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'custom-element','custom-element',{},{"default": () => $$render`${$$unescapeHTML(content)}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_custom-element_with_quoted_attribute.snap b/internal/printer/__snapshots__/set_html_on_custom-element_with_quoted_attribute.snap
new file mode 100755
index 000000000..69d3478e2
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_custom-element_with_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_custom-element_with_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'custom-element','custom-element',{},{"default": () => $$render`${"content"}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_custom-element_with_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_html_on_custom-element_with_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..070e13aa9
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_custom-element_with_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_custom-element_with_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'custom-element','custom-element',{},{"default": () => $$render`${`${content}`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_custom-element_with_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_html_on_custom-element_with_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..6fec1b799
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_custom-element_with_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_custom-element_with_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'custom-element','custom-element',{},{"default": () => $$render`${`content`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_empty_tag.snap b/internal/printer/__snapshots__/set_html_on_empty_tag.snap
new file mode 100755
index 000000000..aa8fdb335
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_empty_tag.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_empty_tag - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$unescapeHTML(content)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_empty_tag_with_quoted_attribute.snap b/internal/printer/__snapshots__/set_html_on_empty_tag_with_quoted_attribute.snap
new file mode 100755
index 000000000..b4d4ce8be
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_empty_tag_with_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_empty_tag_with_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${"content"}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_empty_tag_with_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_html_on_empty_tag_with_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..c670581cf
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_empty_tag_with_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_empty_tag_with_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`${content}`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_empty_tag_with_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_html_on_empty_tag_with_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..169ecb33e
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_empty_tag_with_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_empty_tag_with_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`content`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_script.snap b/internal/printer/__snapshots__/set_html_on_script.snap
new file mode 100755
index 000000000..704b9a819
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_script.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_script - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_script_with_quoted_attribute.snap b/internal/printer/__snapshots__/set_html_on_script_with_quoted_attribute.snap
new file mode 100755
index 000000000..16afbae21
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_script_with_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_script_with_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_script_with_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_html_on_script_with_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..e13a7e936
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_script_with_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_script_with_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_script_with_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_html_on_script_with_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..3accc5210
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_script_with_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_script_with_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_self-closing_tag.snap b/internal/printer/__snapshots__/set_html_on_self-closing_tag.snap
new file mode 100755
index 000000000..0581c6114
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_self-closing_tag.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_self-closing_tag - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$unescapeHTML(content)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_self-closing_tag_with_quoted_attribute.snap b/internal/printer/__snapshots__/set_html_on_self-closing_tag_with_quoted_attribute.snap
new file mode 100755
index 000000000..96470f3c6
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_self-closing_tag_with_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_self-closing_tag_with_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${"content"}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_self-closing_tag_with_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_html_on_self-closing_tag_with_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..8b04af08c
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_self-closing_tag_with_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_self-closing_tag_with_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`${content}`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_self-closing_tag_with_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_html_on_self-closing_tag_with_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..5682f31b3
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_self-closing_tag_with_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_self-closing_tag_with_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`content`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_style.snap b/internal/printer/__snapshots__/set_html_on_style.snap
new file mode 100755
index 000000000..e8c5b8a14
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_style.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_style - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_style_with_quoted_attribute.snap b/internal/printer/__snapshots__/set_html_on_style_with_quoted_attribute.snap
new file mode 100755
index 000000000..d37a87040
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_style_with_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_style_with_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_style_with_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_html_on_style_with_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..a1589416e
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_style_with_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_style_with_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_style_with_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_html_on_style_with_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..c2b7edef6
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_style_with_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_style_with_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_tag_with_children.snap b/internal/printer/__snapshots__/set_html_on_tag_with_children.snap
new file mode 100755
index 000000000..b9286bef2
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_tag_with_children.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_tag_with_children - 1]
+## Input
+
+```
+!!!
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$unescapeHTML(content)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_tag_with_children_and_quoted_attribute.snap b/internal/printer/__snapshots__/set_html_on_tag_with_children_and_quoted_attribute.snap
new file mode 100755
index 000000000..8f6a06562
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_tag_with_children_and_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_tag_with_children_and_quoted_attribute - 1]
+## Input
+
+```
+!!!
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${"content"}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_tag_with_children_and_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_html_on_tag_with_children_and_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..e7b350225
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_tag_with_children_and_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_tag_with_children_and_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+!!!
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`${content}`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_tag_with_children_and_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_html_on_tag_with_children_and_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..5a4c94970
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_tag_with_children_and_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_tag_with_children_and_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+!!!
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`content`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace.snap b/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace.snap
new file mode 100755
index 000000000..889614661
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_tag_with_empty_whitespace - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$unescapeHTML(content)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace_and_quoted_attribute.snap b/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace_and_quoted_attribute.snap
new file mode 100755
index 000000000..41487a1bc
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace_and_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_tag_with_empty_whitespace_and_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${"content"}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace_and_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace_and_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..e9b02534e
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace_and_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_tag_with_empty_whitespace_and_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`${content}`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace_and_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace_and_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..5bcf9f004
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_on_tag_with_empty_whitespace_and_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_on_tag_with_empty_whitespace_and_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`content`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_with_other_attributes.snap b/internal/printer/__snapshots__/set_html_with_other_attributes.snap
new file mode 100755
index 000000000..66b8dc4fc
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_with_other_attributes.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_with_other_attributes - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$unescapeHTML(content)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_with_quoted_attribute.snap b/internal/printer/__snapshots__/set_html_with_quoted_attribute.snap
new file mode 100755
index 000000000..4ffa3d4e4
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_with_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_with_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${"content"}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_with_quoted_attribute_and_other_attributes.snap b/internal/printer/__snapshots__/set_html_with_quoted_attribute_and_other_attributes.snap
new file mode 100755
index 000000000..4189ec268
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_with_quoted_attribute_and_other_attributes.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_with_quoted_attribute_and_other_attributes - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${"content"}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_with_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_html_with_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..4f15145c1
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_with_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_with_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`${content}`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_with_template_literal_attribute_with_variable_and_other_attributes.snap b/internal/printer/__snapshots__/set_html_with_template_literal_attribute_with_variable_and_other_attributes.snap
new file mode 100755
index 000000000..1a1e422ac
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_with_template_literal_attribute_with_variable_and_other_attributes.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_with_template_literal_attribute_with_variable_and_other_attributes - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`${content}`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_with_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_html_with_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..f1ac4d5d2
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_with_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_with_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`content`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_html_with_template_literal_attribute_without_variable_and_other_attributes.snap b/internal/printer/__snapshots__/set_html_with_template_literal_attribute_without_variable_and_other_attributes.snap
new file mode 100755
index 000000000..d9d343dec
--- /dev/null
+++ b/internal/printer/__snapshots__/set_html_with_template_literal_attribute_without_variable_and_other_attributes.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:html_with_template_literal_attribute_without_variable_and_other_attributes - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`content`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text.snap b/internal/printer/__snapshots__/set_text.snap
new file mode 100755
index 000000000..853449cf8
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${content}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text_on_Component.snap b/internal/printer/__snapshots__/set_text_on_Component.snap
new file mode 100755
index 000000000..a4052bc4c
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text_on_Component.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text_on_Component - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`${content}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text_on_Component_with_quoted_attribute.snap b/internal/printer/__snapshots__/set_text_on_Component_with_quoted_attribute.snap
new file mode 100755
index 000000000..e25fb6706
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text_on_Component_with_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text_on_Component_with_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`content`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text_on_Component_with_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_text_on_Component_with_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..2348bf667
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text_on_Component_with_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text_on_Component_with_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`${`${content}`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text_on_Component_with_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_text_on_Component_with_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..acd40ccc7
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text_on_Component_with_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text_on_Component_with_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`${`content`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text_on_custom-element.snap b/internal/printer/__snapshots__/set_text_on_custom-element.snap
new file mode 100755
index 000000000..2988d0cb8
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text_on_custom-element.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text_on_custom-element - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'custom-element','custom-element',{},{"default": () => $$render`${content}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text_on_custom-element_with_quoted_attribute.snap b/internal/printer/__snapshots__/set_text_on_custom-element_with_quoted_attribute.snap
new file mode 100755
index 000000000..640dd91d6
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text_on_custom-element_with_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text_on_custom-element_with_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'custom-element','custom-element',{},{"default": () => $$render`content`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text_on_custom-element_with_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_text_on_custom-element_with_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..c95bddd30
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text_on_custom-element_with_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text_on_custom-element_with_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'custom-element','custom-element',{},{"default": () => $$render`${`${content}`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text_on_custom-element_with_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_text_on_custom-element_with_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..4e0944630
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text_on_custom-element_with_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text_on_custom-element_with_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'custom-element','custom-element',{},{"default": () => $$render`${`content`}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text_with_quoted_attribute.snap b/internal/printer/__snapshots__/set_text_with_quoted_attribute.snap
new file mode 100755
index 000000000..6718bf3fe
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text_with_quoted_attribute.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text_with_quoted_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}content`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text_with_template_literal_attribute_with_variable.snap b/internal/printer/__snapshots__/set_text_with_template_literal_attribute_with_variable.snap
new file mode 100755
index 000000000..1ddc834e8
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text_with_template_literal_attribute_with_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text_with_template_literal_attribute_with_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`${content}`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/set_text_with_template_literal_attribute_without_variable.snap b/internal/printer/__snapshots__/set_text_with_template_literal_attribute_without_variable.snap
new file mode 100755
index 000000000..78e9a3b7c
--- /dev/null
+++ b/internal/printer/__snapshots__/set_text_with_template_literal_attribute_without_variable.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/set:text_with_template_literal_attribute_without_variable - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${`content`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/sibling_expressions.snap b/internal/printer/__snapshots__/sibling_expressions.snap
new file mode 100755
index 000000000..aa3fbe1f2
--- /dev/null
+++ b/internal/printer/__snapshots__/sibling_expressions.snap
@@ -0,0 +1,53 @@
+
+[TestPrinter/sibling_expressions - 1]
+## Input
+
+```
+
+
+ {true ? (Row 1 |
) : null}
+ {true ? (Row 2 |
) : null}
+ {true ? (Row 3 |
) : null}
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}
+
+ ${true ? ($$render`Row 1 |
`) : null}
+ ${true ? ($$render`Row 2 |
`) : null}
+ ${true ? ($$render`Row 3 |
`) : null}
+
+`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/simple_ternary.snap b/internal/printer/__snapshots__/simple_ternary.snap
new file mode 100755
index 000000000..f09f36dc2
--- /dev/null
+++ b/internal/printer/__snapshots__/simple_ternary.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/simple_ternary - 1]
+## Input
+
+```
+{link ? {link} : no link
}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${link ? $$render`${link}` : $$render`no link
`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/slot_inside_of_Base.snap b/internal/printer/__snapshots__/slot_inside_of_Base.snap
new file mode 100755
index 000000000..adf19af70
--- /dev/null
+++ b/internal/printer/__snapshots__/slot_inside_of_Base.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/slot_inside_of_Base - 1]
+## Input
+
+```
+Hello
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Base',Base,{"title":"Home"},{"default": () => $$render`${$$maybeRenderHead($$result)}Hello
`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/slot_with_fallback.snap b/internal/printer/__snapshots__/slot_with_fallback.snap
new file mode 100755
index 000000000..45e425c8c
--- /dev/null
+++ b/internal/printer/__snapshots__/slot_with_fallback.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/slot_with_fallback - 1]
+## Input
+
+```
+Hello world!
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderSlot($$result,$$slots["default"],$$render`Hello world!
`)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/slot_with_fallback_II.snap b/internal/printer/__snapshots__/slot_with_fallback_II.snap
new file mode 100755
index 000000000..83868fc4b
--- /dev/null
+++ b/internal/printer/__snapshots__/slot_with_fallback_II.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/slot_with_fallback_II - 1]
+## Input
+
+```
+Hello world!
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderSlot($$result,$$slots["test"],$$render`${$$maybeRenderHead($$result)}Hello world!
`)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/slot_with_fallback_III.snap b/internal/printer/__snapshots__/slot_with_fallback_III.snap
new file mode 100755
index 000000000..166993e13
--- /dev/null
+++ b/internal/printer/__snapshots__/slot_with_fallback_III.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/slot_with_fallback_III - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderSlot($$result,$$slots["test"],$$render`
Fallback
`)}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/slot_with_quoted_attributes.snap b/internal/printer/__snapshots__/slot_with_quoted_attributes.snap
new file mode 100755
index 000000000..c9c4cf72c
--- /dev/null
+++ b/internal/printer/__snapshots__/slot_with_quoted_attributes.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/slot_with_quoted_attributes - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"\"name\"": () => $$render`${$$maybeRenderHead($$result)}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/slots__basic_.snap b/internal/printer/__snapshots__/slots__basic_.snap
new file mode 100755
index 000000000..1f05996c4
--- /dev/null
+++ b/internal/printer/__snapshots__/slots__basic_.snap
@@ -0,0 +1,53 @@
+
+[TestPrinter/slots_(basic) - 1]
+## Input
+
+```
+/-/-/-/
+import Component from "test";
+/-/-/-/
+
+ Default
+ Named
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import Component from "test";
+
+import * as $$module1 from 'test';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: 'test', assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`
+ ${$$maybeRenderHead($$result)}Default
+
+`,"named": () => $$render`Named
`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/slots__dynamic_name_.snap b/internal/printer/__snapshots__/slots__dynamic_name_.snap
new file mode 100755
index 000000000..38feae1dc
--- /dev/null
+++ b/internal/printer/__snapshots__/slots__dynamic_name_.snap
@@ -0,0 +1,53 @@
+
+[TestPrinter/slots_(dynamic_name) - 1]
+## Input
+
+```
+/-/-/-/
+import Component from 'test';
+const name = 'named';
+ ---
+
+ Named
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import Component from 'test';
+
+import * as $$module1 from 'test';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: 'test', assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const name = 'named';
+
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{[name]: () => $$render`${$$maybeRenderHead($$result)}Named
`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/slots__expression_.snap b/internal/printer/__snapshots__/slots__expression_.snap
new file mode 100755
index 000000000..1fb70aded
--- /dev/null
+++ b/internal/printer/__snapshots__/slots__expression_.snap
@@ -0,0 +1,43 @@
+
+[TestPrinter/slots_(expression) - 1]
+## Input
+
+```
+
+ {items.map(item => {item}
)}
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{"data":(data)},{"default": () => $$render`${items.map(item => $$render`${$$maybeRenderHead($$result)}${item}
`)}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/slots__named_only_.snap b/internal/printer/__snapshots__/slots__named_only_.snap
new file mode 100755
index 000000000..75711b40b
--- /dev/null
+++ b/internal/printer/__snapshots__/slots__named_only_.snap
@@ -0,0 +1,45 @@
+
+[TestPrinter/slots_(named_only) - 1]
+## Input
+
+```
+
+ A
+ B
+ C
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Slotted',Slotted,{},{"a": () => $$render`${$$maybeRenderHead($$result)}A`,"b": () => $$render`B`,"c": () => $$render`C`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/slots__no_comments_.snap b/internal/printer/__snapshots__/slots__no_comments_.snap
new file mode 100755
index 000000000..7568a2db6
--- /dev/null
+++ b/internal/printer/__snapshots__/slots__no_comments_.snap
@@ -0,0 +1,55 @@
+
+[TestPrinter/slots_(no_comments) - 1]
+## Input
+
+```
+/-/-/-/
+import Component from 'test';
+/-/-/-/
+
+ Default
+
+ Named
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import Component from 'test';
+
+import * as $$module1 from 'test';
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [{ module: $$module1, specifier: 'test', assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`
+ ${$$maybeRenderHead($$result)}Default
+
+
+`,"named": () => $$render`Named
`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/small_expression.snap b/internal/printer/__snapshots__/small_expression.snap
new file mode 100755
index 000000000..48e74a5e0
--- /dev/null
+++ b/internal/printer/__snapshots__/small_expression.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/small_expression - 1]
+## Input
+
+```
+{a}{data.map(a => )}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${a}${data.map(a => $$render`${$$renderComponent($$result,'Component',Component,{"value":(a)})}`)}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/solidus_in_template_literal_expression.snap b/internal/printer/__snapshots__/solidus_in_template_literal_expression.snap
new file mode 100755
index 000000000..579b1c064
--- /dev/null
+++ b/internal/printer/__snapshots__/solidus_in_template_literal_expression.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/solidus_in_template_literal_expression - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/spread_with_double_quotation_marks.snap b/internal/printer/__snapshots__/spread_with_double_quotation_marks.snap
new file mode 100755
index 000000000..18b833ff0
--- /dev/null
+++ b/internal/printer/__snapshots__/spread_with_double_quotation_marks.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/spread_with_double_quotation_marks - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/spread_with_style_but_no_explicit_class.snap b/internal/printer/__snapshots__/spread_with_style_but_no_explicit_class.snap
new file mode 100755
index 000000000..b5ddae568
--- /dev/null
+++ b/internal/printer/__snapshots__/spread_with_style_but_no_explicit_class.snap
@@ -0,0 +1,45 @@
+
+[TestPrinter/spread_with_style_but_no_explicit_class - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$Component;
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/spread_without_style_or_class.snap b/internal/printer/__snapshots__/spread_without_style_or_class.snap
new file mode 100755
index 000000000..3a490af24
--- /dev/null
+++ b/internal/printer/__snapshots__/spread_without_style_or_class.snap
@@ -0,0 +1,45 @@
+
+[TestPrinter/spread_without_style_or_class - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$Component;
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/styles__no_frontmatter_.snap b/internal/printer/__snapshots__/styles__no_frontmatter_.snap
new file mode 100755
index 000000000..935863b54
--- /dev/null
+++ b/internal/printer/__snapshots__/styles__no_frontmatter_.snap
@@ -0,0 +1,56 @@
+
+[TestPrinter/styles_(no_frontmatter) - 1]
+## Input
+
+```
+
+
+ Page Title
+ I’m a page
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`
+
+ ${$$maybeRenderHead($$result)}Page Title
+ I’m a page
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/svg_expressions.snap b/internal/printer/__snapshots__/svg_expressions.snap
new file mode 100755
index 000000000..c71f6cad1
--- /dev/null
+++ b/internal/printer/__snapshots__/svg_expressions.snap
@@ -0,0 +1,46 @@
+
+[TestPrinter/svg_expressions - 1]
+## Input
+
+```
+/-/-/-/
+const title = 'icon';
+/-/-/-/
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const title = 'icon';
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table.snap b/internal/printer/__snapshots__/table.snap
new file mode 100755
index 000000000..48b958aac
--- /dev/null
+++ b/internal/printer/__snapshots__/table.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/table - 1]
+## Input
+
+```
+{[0,1,2].map(x => ({x} | ))}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${[0,1,2].map(x => ($$render`${x} | `))}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_II.snap b/internal/printer/__snapshots__/table_II.snap
new file mode 100755
index 000000000..1c763335d
--- /dev/null
+++ b/internal/printer/__snapshots__/table_II.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/table_II - 1]
+## Input
+
+```
+{['Hey','Ho'].map((item)=> {item} | )}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${['Hey','Ho'].map((item)=> $$render`${item} | `)}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_III.snap b/internal/printer/__snapshots__/table_III.snap
new file mode 100755
index 000000000..01ca27eeb
--- /dev/null
+++ b/internal/printer/__snapshots__/table_III.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/table_III - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}Cell | ${$$renderComponent($$result,'Cell',Cell,{})}${$$renderComponent($$result,'Cell',Cell,{})}${$$renderComponent($$result,'Cell',Cell,{})}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_IV.snap b/internal/printer/__snapshots__/table_IV.snap
new file mode 100755
index 000000000..869d01290
--- /dev/null
+++ b/internal/printer/__snapshots__/table_IV.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/table_IV - 1]
+## Input
+
+```
+hello world |
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}hello world |
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_caption_expression.snap b/internal/printer/__snapshots__/table_caption_expression.snap
new file mode 100755
index 000000000..7f871ad72
--- /dev/null
+++ b/internal/printer/__snapshots__/table_caption_expression.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/table_caption_expression - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_expression_with_trailing_div.snap b/internal/printer/__snapshots__/table_expression_with_trailing_div.snap
new file mode 100755
index 000000000..14834b680
--- /dev/null
+++ b/internal/printer/__snapshots__/table_expression_with_trailing_div.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/table_expression_with_trailing_div - 1]
+## Input
+
+```
+Div
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}Div
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_expressions__no_implicit_tbody_.snap b/internal/printer/__snapshots__/table_expressions__no_implicit_tbody_.snap
new file mode 100755
index 000000000..5e0c43ab0
--- /dev/null
+++ b/internal/printer/__snapshots__/table_expressions__no_implicit_tbody_.snap
@@ -0,0 +1,46 @@
+
+[TestPrinter/table_expressions_(no_implicit_tbody) - 1]
+## Input
+
+```
+/-/-/-/
+const items = ["Dog", "Cat", "Platipus"];
+/-/-/-/
+{items.map(item => ({item} |
))}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const items = ["Dog", "Cat", "Platipus"];
+
+return $$render`${$$maybeRenderHead($$result)}${items.map(item => ($$render`${item} |
`))}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_simple_case.snap b/internal/printer/__snapshots__/table_simple_case.snap
new file mode 100755
index 000000000..f40d2a822
--- /dev/null
+++ b/internal/printer/__snapshots__/table_simple_case.snap
@@ -0,0 +1,76 @@
+
+[TestPrinter/table_simple_case - 1]
+## Input
+
+```
+/-/-/-/
+const content = "lol";
+/-/-/-/
+
+
+
+
+
+ {content} |
+
+ {
+ (
+
+ 1 |
+
+ )
+ }
+
Hello
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const content = "lol";
+
+return $$render`
+ ${$$maybeRenderHead($$result)}
+
+
+ ${content} |
+
+ ${
+ (
+ $$render`
+ 1 |
+
`
+ )
+ }
+
Hello
+ `;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_slot_I.snap b/internal/printer/__snapshots__/table_slot_I.snap
new file mode 100755
index 000000000..e4e97824f
--- /dev/null
+++ b/internal/printer/__snapshots__/table_slot_I.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/table_slot_I - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderSlot($$result,$$slots["default"])}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_slot_II.snap b/internal/printer/__snapshots__/table_slot_II.snap
new file mode 100755
index 000000000..5ad7f9232
--- /dev/null
+++ b/internal/printer/__snapshots__/table_slot_II.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/table_slot_II - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderSlot($$result,$$slots["default"])}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_slot_III.snap b/internal/printer/__snapshots__/table_slot_III.snap
new file mode 100755
index 000000000..82cc88a6a
--- /dev/null
+++ b/internal/printer/__snapshots__/table_slot_III.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/table_slot_III - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderSlot($$result,$$slots["default"])} |
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_slot_IV.snap b/internal/printer/__snapshots__/table_slot_IV.snap
new file mode 100755
index 000000000..acb47d3df
--- /dev/null
+++ b/internal/printer/__snapshots__/table_slot_IV.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/table_slot_IV - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderSlot($$result,$$slots["default"])}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_slot_V.snap b/internal/printer/__snapshots__/table_slot_V.snap
new file mode 100755
index 000000000..288d194f1
--- /dev/null
+++ b/internal/printer/__snapshots__/table_slot_V.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/table_slot_V - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${$$renderSlot($$result,$$slots["default"])}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/table_with_expression_in_'th'.snap b/internal/printer/__snapshots__/table_with_expression_in_'th'.snap
new file mode 100755
index 000000000..6459a0d10
--- /dev/null
+++ b/internal/printer/__snapshots__/table_with_expression_in_'th'.snap
@@ -0,0 +1,133 @@
+
+[TestPrinter/table_with_expression_in_'th' - 1]
+## Input
+
+```
+/-/-/-/
+const { title, footnotes, tables } = Astro.props;
+
+interface Table {
+ title: string;
+ data: any[];
+ showTitle: boolean;
+ footnotes: string;
+}
+console.log(tables);
+/-/-/-/
+
+
+
+
+ {title}
+
+ {
+ tables.map((table: Table) => (
+ <>
+
+
{table.title}
+
+
+ {Object.keys(table.data[0]).map((thead) => (
+ {thead} |
+ ))}
+
+
+ {table.data.map((trow) => (
+
+ {Object.values(trow).map((cell, index) => (
+
+ {cell}
+ |
+ ))}
+
+ ))}
+
+
+
+ >
+ ))
+ }
+
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$Component;
+
+const { title, footnotes, tables } = Astro.props;
+
+interface Table {
+ title: string;
+ data: any[];
+ showTitle: boolean;
+ footnotes: string;
+}
+console.log(tables);
+
+return $$render`${$$maybeRenderHead($$result)}
+
+
+ ${title}
+
+ ${
+ tables.map((table: Table) => (
+ $$render`${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`
+
+
${table.title}
+
+
+ ${Object.keys(table.data[0]).map((thead) => (
+ $$render`${thead} | `
+ ))}
+
+
+ ${table.data.map((trow) => (
+ $$render`
+ ${Object.values(trow).map((cell, index) => (
+ $$render`
+ ${cell}
+ | `
+ ))}
+
`
+ ))}
+
+
+
+ `,})}`
+ ))
+ }
+
+
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/tbody_expressions.snap b/internal/printer/__snapshots__/tbody_expressions.snap
new file mode 100755
index 000000000..d0552cb58
--- /dev/null
+++ b/internal/printer/__snapshots__/tbody_expressions.snap
@@ -0,0 +1,46 @@
+
+[TestPrinter/tbody_expressions - 1]
+## Input
+
+```
+/-/-/-/
+const items = ["Dog", "Cat", "Platipus"];
+/-/-/-/
+Name |
{items.map(item => ({item} |
))}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const items = ["Dog", "Cat", "Platipus"];
+
+return $$render`${$$maybeRenderHead($$result)}Name |
${items.map(item => ($$render`${item} |
`))}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/tbody_expressions_2.snap b/internal/printer/__snapshots__/tbody_expressions_2.snap
new file mode 100755
index 000000000..4d6380ecc
--- /dev/null
+++ b/internal/printer/__snapshots__/tbody_expressions_2.snap
@@ -0,0 +1,46 @@
+
+[TestPrinter/tbody_expressions_2 - 1]
+## Input
+
+```
+/-/-/-/
+const items = ["Dog", "Cat", "Platipus"];
+/-/-/-/
+Name |
{items.map(item => ({item} | {item + 's'} |
))}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const items = ["Dog", "Cat", "Platipus"];
+
+return $$render`${$$maybeRenderHead($$result)}Name |
${items.map(item => ($$render`${item} | ${item + 's'} |
`))}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/tbody_expressions_3.snap b/internal/printer/__snapshots__/tbody_expressions_3.snap
new file mode 100755
index 000000000..acde1a1a6
--- /dev/null
+++ b/internal/printer/__snapshots__/tbody_expressions_3.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/tbody_expressions_3 - 1]
+## Input
+
+```
+{rows.map(row => ({row} |
))}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${rows.map(row => ($$render`${row} |
`))}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/td_expressions.snap b/internal/printer/__snapshots__/td_expressions.snap
new file mode 100755
index 000000000..97bf09d58
--- /dev/null
+++ b/internal/printer/__snapshots__/td_expressions.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/td_expressions - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/td_expressions_II.snap b/internal/printer/__snapshots__/td_expressions_II.snap
new file mode 100755
index 000000000..5acc0b745
--- /dev/null
+++ b/internal/printer/__snapshots__/td_expressions_II.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/td_expressions_II - 1]
+## Input
+
+```
+{data.map(row => {row.map(cell => {cell} | )}
)}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${data.map(row => $$render`${row.map(cell => $$render`${cell} | `)}
`)}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/template_literal_attribute_on_component.snap b/internal/printer/__snapshots__/template_literal_attribute_on_component.snap
new file mode 100755
index 000000000..b0353259c
--- /dev/null
+++ b/internal/printer/__snapshots__/template_literal_attribute_on_component.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/template_literal_attribute_on_component - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{"class":`red`})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/template_literal_attribute_with_variable_on_component.snap b/internal/printer/__snapshots__/template_literal_attribute_with_variable_on_component.snap
new file mode 100755
index 000000000..64e8f2566
--- /dev/null
+++ b/internal/printer/__snapshots__/template_literal_attribute_with_variable_on_component.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/template_literal_attribute_with_variable_on_component - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{"class":`${color}`})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/ternary_component.snap b/internal/printer/__snapshots__/ternary_component.snap
new file mode 100755
index 000000000..f1ed17001
--- /dev/null
+++ b/internal/printer/__snapshots__/ternary_component.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/ternary_component - 1]
+## Input
+
+```
+{special ? Special
: Not special
}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${special ? $$render`${$$renderComponent($$result,'ChildDiv',ChildDiv,{},{"default": () => $$render`${$$maybeRenderHead($$result)}Special
`,})}` : $$render`Not special
`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/ternary_layout.snap b/internal/printer/__snapshots__/ternary_layout.snap
new file mode 100755
index 000000000..812e6d87f
--- /dev/null
+++ b/internal/printer/__snapshots__/ternary_layout.snap
@@ -0,0 +1,45 @@
+
+[TestPrinter/ternary_layout - 1]
+## Input
+
+```
+{toggleError ? SITE: {Astro.site}
: <>SITE: {Astro.site}
>}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Astro = $$createAstro('https://astro.build');
+const Astro = $$Astro;
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+const Astro = $$result.createAstro($$Astro, $$props, $$slots);
+Astro.self = $$Component;
+
+return $$render`${toggleError ? $$render`${$$renderComponent($$result,'BaseLayout',BaseLayout,{},{"default": () => $$render`${$$maybeRenderHead($$result)}SITE: ${Astro.site}
`,})}` : $$render`${$$renderComponent($$result,'Fragment',Fragment,{},{"default": () => $$render`SITE: ${Astro.site}
`,})}`}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/ternary_slot.snap b/internal/printer/__snapshots__/ternary_slot.snap
new file mode 100755
index 000000000..996f5d179
--- /dev/null
+++ b/internal/printer/__snapshots__/ternary_slot.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/ternary_slot - 1]
+## Input
+
+```
+{Math.random() > 0.5 ? A
: B
}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},$$mergeSlots({},Math.random() > 0.5 ? {"a": () => $$render`${$$maybeRenderHead($$result)}A
`} : {"b": () => $$render`B
`}))}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/text_after_title_expression.snap b/internal/printer/__snapshots__/text_after_title_expression.snap
new file mode 100755
index 000000000..0ac466dd3
--- /dev/null
+++ b/internal/printer/__snapshots__/text_after_title_expression.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/text_after_title_expression - 1]
+## Input
+
+```
+a {expr} b
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`a ${expr} b`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/text_after_title_expressions.snap b/internal/printer/__snapshots__/text_after_title_expressions.snap
new file mode 100755
index 000000000..00ebf410f
--- /dev/null
+++ b/internal/printer/__snapshots__/text_after_title_expressions.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/text_after_title_expressions - 1]
+## Input
+
+```
+a {expr} b {expr} c
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`a ${expr} b ${expr} c`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/text_only.snap b/internal/printer/__snapshots__/text_only.snap
new file mode 100755
index 000000000..ea448282d
--- /dev/null
+++ b/internal/printer/__snapshots__/text_only.snap
@@ -0,0 +1,82 @@
+
+[TestPrinter/text_only - 1]
+## Input
+
+```
+Foo
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`Foo`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
+
+[TestPrinter/text_only#01 - 1]
+## Input
+
+```
+Hello!
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`Hello!`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/textarea.snap b/internal/printer/__snapshots__/textarea.snap
new file mode 100755
index 000000000..a3ce6a282
--- /dev/null
+++ b/internal/printer/__snapshots__/textarea.snap
@@ -0,0 +1,46 @@
+
+[TestPrinter/textarea - 1]
+## Input
+
+```
+/-/-/-/
+const value = 'test';
+/-/-/-/
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+const value = 'test';
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/textarea_in_form.snap b/internal/printer/__snapshots__/textarea_in_form.snap
new file mode 100755
index 000000000..9d95b54b3
--- /dev/null
+++ b/internal/printer/__snapshots__/textarea_in_form.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/textarea_in_form - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{},{"default": () => $$render`${$$maybeRenderHead($$result)}`,})}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/textarea_inside_expression.snap b/internal/printer/__snapshots__/textarea_inside_expression.snap
new file mode 100755
index 000000000..4f6d6c078
--- /dev/null
+++ b/internal/printer/__snapshots__/textarea_inside_expression.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/textarea_inside_expression - 1]
+## Input
+
+```
+{bool && } {!bool && }
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${bool && $$render`${$$maybeRenderHead($$result)}`} ${!bool && $$render``}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/th_expressions.snap b/internal/printer/__snapshots__/th_expressions.snap
new file mode 100755
index 000000000..99f5fe8ff
--- /dev/null
+++ b/internal/printer/__snapshots__/th_expressions.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/th_expressions - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/tr_only.snap b/internal/printer/__snapshots__/tr_only.snap
new file mode 100755
index 000000000..b5c43c811
--- /dev/null
+++ b/internal/printer/__snapshots__/tr_only.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/tr_only - 1]
+## Input
+
+```
+col 1 | col 2 | {foo} |
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}col 1 | col 2 | ${foo} |
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/trailing_expression.snap b/internal/printer/__snapshots__/trailing_expression.snap
new file mode 100755
index 000000000..4e890049c
--- /dev/null
+++ b/internal/printer/__snapshots__/trailing_expression.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/trailing_expression - 1]
+## Input
+
+```
+{}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{})}${(void 0)}`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/transition_animate_on_Component.snap b/internal/printer/__snapshots__/transition_animate_on_Component.snap
new file mode 100755
index 000000000..bea44a654
--- /dev/null
+++ b/internal/printer/__snapshots__/transition_animate_on_Component.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/transition:animate_on_Component - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import "transitions.css";
+
+export const $$metadata = $$createMetadata("/projects/app/src/pages/page.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Page = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'Component',Component,{"class":"bar","data-astro-transition-scope":($$renderTransition($$result, "wkm5vset", "morph", ""))})}`;
+}, '/projects/app/src/pages/page.astro', 'self');
+export default $$Page;
+```
+---
diff --git a/internal/printer/__snapshots__/transition_animate_with_an_expression.snap b/internal/printer/__snapshots__/transition_animate_with_an_expression.snap
new file mode 100755
index 000000000..2a8cfef84
--- /dev/null
+++ b/internal/printer/__snapshots__/transition_animate_with_an_expression.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/transition:animate_with_an_expression - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import "transitions.css";
+
+export const $$metadata = $$createMetadata("/projects/app/src/pages/page.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Page = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, '/projects/app/src/pages/page.astro', 'self');
+export default $$Page;
+```
+---
diff --git a/internal/printer/__snapshots__/transition_name_with_an_expression.snap b/internal/printer/__snapshots__/transition_name_with_an_expression.snap
new file mode 100755
index 000000000..afdd28fdf
--- /dev/null
+++ b/internal/printer/__snapshots__/transition_name_with_an_expression.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/transition:name_with_an_expression - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import "transitions.css";
+
+export const $$metadata = $$createMetadata("/projects/app/src/pages/page.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Page = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, '/projects/app/src/pages/page.astro', 'self');
+export default $$Page;
+```
+---
diff --git a/internal/printer/__snapshots__/transition_name_with_an_template_literal.snap b/internal/printer/__snapshots__/transition_name_with_an_template_literal.snap
new file mode 100755
index 000000000..adcd84809
--- /dev/null
+++ b/internal/printer/__snapshots__/transition_name_with_an_template_literal.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/transition:name_with_an_template_literal - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import "transitions.css";
+
+export const $$metadata = $$createMetadata("/projects/app/src/pages/page.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Page = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, '/projects/app/src/pages/page.astro', 'self');
+export default $$Page;
+```
+---
diff --git a/internal/printer/__snapshots__/transition_persist-props_converted_to_a_data_attribute.snap b/internal/printer/__snapshots__/transition_persist-props_converted_to_a_data_attribute.snap
new file mode 100755
index 000000000..bce20a07f
--- /dev/null
+++ b/internal/printer/__snapshots__/transition_persist-props_converted_to_a_data_attribute.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/transition:persist-props_converted_to_a_data_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import "transitions.css";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$renderComponent($$result,'my-island','my-island',{"data-astro-transition-persist-props":"false","data-astro-transition-persist":($$createTransitionScope($$result, "otghnj5u"))})}`;
+}, undefined, 'self');
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/transition_persist_converted_to_a_data_attribute.snap b/internal/printer/__snapshots__/transition_persist_converted_to_a_data_attribute.snap
new file mode 100755
index 000000000..869008869
--- /dev/null
+++ b/internal/printer/__snapshots__/transition_persist_converted_to_a_data_attribute.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/transition:persist_converted_to_a_data_attribute - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import "transitions.css";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, 'self');
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/transition_persist_uses_transition_name_if_defined.snap b/internal/printer/__snapshots__/transition_persist_uses_transition_name_if_defined.snap
new file mode 100755
index 000000000..5ae784b94
--- /dev/null
+++ b/internal/printer/__snapshots__/transition_persist_uses_transition_name_if_defined.snap
@@ -0,0 +1,42 @@
+
+[TestPrinter/transition:persist_uses_transition:name_if_defined - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import "transitions.css";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}`;
+}, undefined, 'self');
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/type_import.snap b/internal/printer/__snapshots__/type_import.snap
new file mode 100755
index 000000000..80b6c7298
--- /dev/null
+++ b/internal/printer/__snapshots__/type_import.snap
@@ -0,0 +1,47 @@
+
+[TestPrinter/type_import - 1]
+## Input
+
+```
+/-/-/-/
+import type data from "test"
+/-/-/-/
+
+{data}
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+import type data from "test"
+
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`${$$maybeRenderHead($$result)}${data}
`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/unusual_line_terminator_I.snap b/internal/printer/__snapshots__/unusual_line_terminator_I.snap
new file mode 100755
index 000000000..dd8314cf1
--- /dev/null
+++ b/internal/printer/__snapshots__/unusual_line_terminator_I.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/unusual_line_terminator_I - 1]
+## Input
+
+```
+Pre-set & Time-limited \u2028holiday campaigns
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`Pre-set & Time-limited \\u2028holiday campaigns`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/unusual_line_terminator_II.snap b/internal/printer/__snapshots__/unusual_line_terminator_II.snap
new file mode 100755
index 000000000..78f0e17ad
--- /dev/null
+++ b/internal/printer/__snapshots__/unusual_line_terminator_II.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/unusual_line_terminator_II - 1]
+## Input
+
+```
+Pre-set & Time-limited
holiday campaigns
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render`Pre-set & Time-limited
holiday campaigns`;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/__snapshots__/user-defined_`implicit`_is_printed.snap b/internal/printer/__snapshots__/user-defined_`implicit`_is_printed.snap
new file mode 100755
index 000000000..a28ca3242
--- /dev/null
+++ b/internal/printer/__snapshots__/user-defined_`implicit`_is_printed.snap
@@ -0,0 +1,41 @@
+
+[TestPrinter/user-defined_`implicit`_is_printed - 1]
+## Input
+
+```
+
+```
+
+## Output
+
+```js
+import {
+ Fragment,
+ render as $$render,
+ createAstro as $$createAstro,
+ createComponent as $$createComponent,
+ renderComponent as $$renderComponent,
+ renderHead as $$renderHead,
+ maybeRenderHead as $$maybeRenderHead,
+ unescapeHTML as $$unescapeHTML,
+ renderSlot as $$renderSlot,
+ mergeSlots as $$mergeSlots,
+ addAttribute as $$addAttribute,
+ spreadAttributes as $$spreadAttributes,
+ defineStyleVars as $$defineStyleVars,
+ defineScriptVars as $$defineScriptVars,
+ renderTransition as $$renderTransition,
+ createTransitionScope as $$createTransitionScope,
+ renderScript as $$renderScript,
+ createMetadata as $$createMetadata
+} from "http://localhost:3000/";
+
+export const $$metadata = $$createMetadata(import.meta.url, { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: new Set([]), hoisted: [] });
+
+const $$Component = $$createComponent(($$result, $$props, $$slots) => {
+
+return $$render``;
+}, undefined, undefined);
+export default $$Component;
+```
+---
diff --git a/internal/printer/printer_test.go b/internal/printer/printer_test.go
index 1b2863dfb..454ceaee4 100644
--- a/internal/printer/printer_test.go
+++ b/internal/printer/printer_test.go
@@ -2,12 +2,12 @@ package printer
import (
"fmt"
- "math/rand"
"regexp"
"strconv"
"strings"
"testing"
+ "github.com/gkampitakis/go-snaps/snaps"
astro "github.com/withastro/compiler/internal"
"github.com/withastro/compiler/internal/handler"
types "github.com/withastro/compiler/internal/t"
@@ -49,9 +49,6 @@ export default $$Component;`
var CREATE_ASTRO_CALL = "const $$Astro = $$createAstro('https://astro.build');\nconst Astro = $$Astro;"
var RENDER_HEAD_RESULT = "${$$renderHead($$result)}"
-// SPECIAL TEST FIXTURES
-var NON_WHITESPACE_CHARS = []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[];:'\",.?")
-
func suffixWithFilename(filename string, transitions bool) string {
propagationArg := "undefined"
if transitions {
@@ -96,8 +93,8 @@ type jsonTestcase struct {
func TestPrinter(t *testing.T) {
longRandomString := ""
- for i := 0; i < 4080; i++ {
- longRandomString += string(NON_WHITESPACE_CHARS[rand.Intn(len(NON_WHITESPACE_CHARS))])
+ for i := 0; i < 40; i++ {
+ longRandomString += "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[];:'\",.?"
}
tests := []testcase{
@@ -3707,6 +3704,23 @@ const meta = { title: 'My App' };
if diff := test_utils.ANSIDiff(test_utils.RemoveNewlines(test_utils.Dedent(toMatch)), test_utils.RemoveNewlines(test_utils.Dedent(output))); diff != "" {
t.Errorf("mismatch (-want +got):\n%s", diff)
}
+
+ snapshotName := strings.ReplaceAll(tt.name, "#", "_")
+ snapshotName = strings.ReplaceAll(snapshotName, "<", "_")
+ snapshotName = strings.ReplaceAll(snapshotName, ">", "_")
+ snapshotName = strings.ReplaceAll(snapshotName, ")", "_")
+ snapshotName = strings.ReplaceAll(snapshotName, "(", "_")
+ snapshotName = strings.ReplaceAll(snapshotName, ":", "_")
+ snapshotName = strings.ReplaceAll(snapshotName, " ", "_")
+ snapshotName = strings.ReplaceAll(snapshotName, "#", "_")
+
+ s := snaps.WithConfig(
+ snaps.Filename(snapshotName),
+ )
+
+ snapshot := fmt.Sprintf("%s%s%s%s%s%s%s%s", "## Input\n\n", "```\n", test_utils.Dedent(code), "\n```", "\n\n## Output\n\n", "```js\n", test_utils.Dedent(output), "\n```")
+
+ s.MatchSnapshot(t, snapshot)
})
}
}