diff options
author | 2021-04-30 16:33:35 -0500 | |
---|---|---|
committer | 2021-04-30 16:33:35 -0500 | |
commit | 4df1347156cf2632ea2f3475d3a5f8f08d197cc3 (patch) | |
tree | 9d50de89dfe62827c32a8a4046120af4ab61dc0c /src/frontend | |
parent | 1d498facc8f78a3ffbfecd05cc6ecd45e8a4a1ae (diff) | |
download | astro-4df1347156cf2632ea2f3475d3a5f8f08d197cc3.tar.gz astro-4df1347156cf2632ea2f3475d3a5f8f08d197cc3.tar.zst astro-4df1347156cf2632ea2f3475d3a5f8f08d197cc3.zip |
Migrate to `yarn` monorepo (#157)
* chore: use monorepo
* chore: scaffold astro-scripts
* chore: move tests inside packages/astro
* chore: refactor tests, add scripts
* chore: move parser to own module
* chore: move runtime to packages/astro
* fix: move parser to own package
* test: fix prettier-plugin-astro tests
* fix: tests
* chore: update package-lock
* chore: add changesets
* fix: cleanup examples
* fix: starter example
* chore: update changeset config
* chore: update changeset config
* chore: setup changeset release workflow
* chore: bump lockfiles
* chore: prism => astro-prism
* fix: tsc --emitDeclarationOnly
* chore: final cleanup, switch to yarn
* chore: add lerna
* chore: update workflows to yarn
* chore: update workflows
* chore: remove lint workflow
* chore: add astro-dev script
* chore: add symlinked README
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/500.astro | 128 | ||||
-rw-r--r-- | src/frontend/SvelteWrapper.svelte | 7 | ||||
-rw-r--r-- | src/frontend/SvelteWrapper.svelte.client.ts | 166 | ||||
-rw-r--r-- | src/frontend/SvelteWrapper.svelte.server.ts | 12 | ||||
-rw-r--r-- | src/frontend/h.ts | 65 | ||||
-rw-r--r-- | src/frontend/render/preact.ts | 31 | ||||
-rw-r--r-- | src/frontend/render/react.ts | 29 | ||||
-rw-r--r-- | src/frontend/render/renderer.ts | 61 | ||||
-rw-r--r-- | src/frontend/render/svelte.ts | 26 | ||||
-rw-r--r-- | src/frontend/render/utils.ts | 52 | ||||
-rw-r--r-- | src/frontend/render/vue.ts | 65 | ||||
-rw-r--r-- | src/frontend/runtime/svelte.ts | 10 |
12 files changed, 0 insertions, 652 deletions
diff --git a/src/frontend/500.astro b/src/frontend/500.astro deleted file mode 100644 index 01fab8bea..000000000 --- a/src/frontend/500.astro +++ /dev/null @@ -1,128 +0,0 @@ ---- -import Prism from 'astro/components/Prism.astro'; -let title = 'Uh oh...'; - -const error = Astro.request.url.searchParams.get('error'); ---- - -<!doctype html> -<html lang="en"> - <head> - <title>Error 500</title> - <link rel="preconnect"href="https://fonts.gstatic.com"> - <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&family=IBM+Plex+Sans&display=swap"> - <link rel="stylesheet" href="http://cdn.skypack.dev/prism-themes/themes/prism-material-dark.css"> - - <style> - * { - box-sizing: border-box; - margin: 0; - } - - :global(:root) { - --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; - --font-mono: "IBM Plex Mono", Consolas, "Andale Mono WT", "Andale Mono", - "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", - "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, - "Courier New", Courier, monospace; - --color-gray-800: #1F2937; - --color-gray-500: #6B7280; - --color-gray-400: #9CA3AF; - --color-gray-100: #F3F4F6; - --color-red: #FF1639; - } - - html, body { - width: 100vw; - height: 100%; - min-height: 100vh; - - font-family: var(--font-sans); - font-weight: 400; - background: var(--color-gray-100); - text-align: center; - } - - body { - display: grid; - place-content: center; - } - - header { - display: flex; - flex-direction: column; - align-items: center; - font-family: var(--font-sans); - font-size: 2.5rem; - font-size: clamp(24px, calc(2vw + 1rem), 2.5rem); - } - - header h1 { - margin: 0.25em; - margin-right: 0; - font-weight: 400; - letter-spacing: -2px; - line-height: 1; - } - - header h1 .title { - color: var(--color-gray-400); - white-space: nowrap; - } - - header svg { - margin-bottom: -0.125em; - color: var(--color-red); - } - - p { - font-size: 1.75rem; - font-size: clamp(14px, calc(2vw + 0.5rem), 1.75rem); - flex: 1; - } - - .error-message { - display: grid; - justify-content: center; - margin-top: 4rem; - } - - .error-message :global(code[class*="language-"]) { - background: var(--color-gray-800); - } - .error-message :global(pre) { - margin: 0; - font-family: var(--font-mono); - font-size: 0.85rem; - background: var(--color-gray-800); - border-radius: 8px; - } - - .error-message :global(.token.punctuation) { - color: var(--color-gray-400); - } - - .error-message :global(.token.operator) { - color: var(--color-gray-400); - } - </style> - </head> - <body> - <main> - <header> - <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" width="1.75em" height="1.75em"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" /> - </svg> - <h1><span class="error">500 Error </span><span class="title">{title}</span></h1> - </header> - - <article> - <p>Astro had some trouble loading this page.</p> - - <div class="error-message"> - <Prism lang="shell" code={error} /> - </div> - </article> - </main> - </body> -</html> diff --git a/src/frontend/SvelteWrapper.svelte b/src/frontend/SvelteWrapper.svelte deleted file mode 100644 index eb4cbb7d9..000000000 --- a/src/frontend/SvelteWrapper.svelte +++ /dev/null @@ -1,7 +0,0 @@ -<script> -const { __astro_component: Component, __astro_children, ...props } = $$props; -</script> - -<Component {...props}> - {@html __astro_children} -</Component> diff --git a/src/frontend/SvelteWrapper.svelte.client.ts b/src/frontend/SvelteWrapper.svelte.client.ts deleted file mode 100644 index 9df168895..000000000 --- a/src/frontend/SvelteWrapper.svelte.client.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* eslint-disable */ -// @ts-nocheck -// TODO: don't precompile this, but it works for now -import { - HtmlTag, - SvelteComponentDev, - assign, - claim_component, - create_component, - destroy_component, - detach_dev, - dispatch_dev, - empty, - exclude_internal_props, - get_spread_object, - get_spread_update, - init, - insert_dev, - mount_component, - noop, - not_equal, - transition_in, - transition_out, - validate_slots, -} from 'svelte/internal'; - -const file = 'App.svelte'; - -// (5:0) <Component {...props}> -function create_default_slot(ctx) { - let html_tag; - let html_anchor; - - const block = { - c: function create() { - html_anchor = empty(); - this.h(); - }, - l: function claim(nodes) { - html_anchor = empty(); - this.h(); - }, - h: function hydrate() { - html_tag = new HtmlTag(html_anchor); - }, - m: function mount(target, anchor) { - html_tag.m(/*__astro_children*/ ctx[1], target, anchor); - insert_dev(target, html_anchor, anchor); - }, - p: noop, - d: function destroy(detaching) { - if (detaching) detach_dev(html_anchor); - if (detaching) html_tag.d(); - }, - }; - - dispatch_dev('SvelteRegisterBlock', { - block, - id: create_default_slot.name, - type: 'slot', - source: '(5:0) <Component {...props}>', - ctx, - }); - - return block; -} - -function create_fragment(ctx) { - let component; - let current; - const component_spread_levels = [/*props*/ ctx[2]]; - - let component_props = { - $$slots: { default: [create_default_slot] }, - $$scope: { ctx }, - }; - - for (let i = 0; i < component_spread_levels.length; i += 1) { - component_props = assign(component_props, component_spread_levels[i]); - } - - component = new /*Component*/ ctx[0]({ props: component_props, $$inline: true }); - - const block = { - c: function create() { - create_component(component.$$.fragment); - }, - l: function claim(nodes) { - claim_component(component.$$.fragment, nodes); - }, - m: function mount(target, anchor) { - mount_component(component, target, anchor); - current = true; - }, - p: function update(ctx, [dirty]) { - const component_changes = dirty & /*props*/ 4 ? get_spread_update(component_spread_levels, [get_spread_object(/*props*/ ctx[2])]) : {}; - - if (dirty & /*$$scope*/ 16) { - component_changes.$$scope = { dirty, ctx }; - } - - component.$set(component_changes); - }, - i: function intro(local) { - if (current) return; - transition_in(component.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(component.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - destroy_component(component, detaching); - }, - }; - - dispatch_dev('SvelteRegisterBlock', { - block, - id: create_fragment.name, - type: 'component', - source: '', - ctx, - }); - - return block; -} - -function instance($$self, $$props, $$invalidate) { - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots('App', slots, []); - const { __astro_component: Component, __astro_children, ...props } = $$props; - - $$self.$$set = ($$new_props) => { - $$invalidate(3, ($$props = assign(assign({}, $$props), exclude_internal_props($$new_props)))); - }; - - $$self.$capture_state = () => ({ Component, __astro_children, props }); - - $$self.$inject_state = ($$new_props) => { - $$invalidate(3, ($$props = assign(assign({}, $$props), $$new_props))); - }; - - if ($$props && '$$inject' in $$props) { - $$self.$inject_state($$props.$$inject); - } - - $$props = exclude_internal_props($$props); - return [Component, __astro_children, props]; -} - -class App extends SvelteComponentDev { - constructor(options) { - super(options); - init(this, options, instance, create_fragment, not_equal, {}); - - dispatch_dev('SvelteRegisterComponent', { - component: this, - tagName: 'App', - options, - id: create_fragment.name, - }); - } -} - -export default App; diff --git a/src/frontend/SvelteWrapper.svelte.server.ts b/src/frontend/SvelteWrapper.svelte.server.ts deleted file mode 100644 index c5a25ff03..000000000 --- a/src/frontend/SvelteWrapper.svelte.server.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* eslint-disable */ -// @ts-nocheck -// TODO: don't precompile this, but it works for now -/* App.svelte generated by Svelte v3.37.0 */ -import { create_ssr_component, validate_component } from 'svelte/internal'; - -const App = create_ssr_component(($$result, $$props, $$bindings, slots) => { - const { __astro_component: Component, __astro_children, ...props } = $$props; - return `${validate_component(Component, 'Component').$$render($$result, Object.assign(props), {}, { default: () => `${__astro_children}` })}`; -}); - -export default App; diff --git a/src/frontend/h.ts b/src/frontend/h.ts deleted file mode 100644 index c1e21dc95..000000000 --- a/src/frontend/h.ts +++ /dev/null @@ -1,65 +0,0 @@ -export type HProps = Record<string, string> | null | undefined; -export type HChild = string | undefined | (() => string); -export type AstroComponent = (props: HProps, ...children: Array<HChild>) => string; -export type HTag = string | AstroComponent; - -const voidTags = new Set(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']); - -/** Generator for primary h() function */ -function* _h(tag: string, attrs: HProps, children: Array<HChild>) { - if (tag === '!doctype') { - yield '<!doctype '; - if (attrs) { - yield Object.keys(attrs).join(' '); - } - yield '>'; - return; - } - - yield `<${tag}`; - if (attrs) { - yield ' '; - for (let [key, value] of Object.entries(attrs)) { - yield `${key}="${value}"`; - } - } - yield '>'; - - // Void tags have no children. - if (voidTags.has(tag)) { - return; - } - - for (let child of children) { - // Special: If a child is a function, call it automatically. - // This lets you do {() => ...} without the extra boilerplate - // of wrapping it in a function and calling it. - if (typeof child === 'function') { - yield child(); - } else if (typeof child === 'string') { - yield child; - } else if (!child) { - // do nothing, safe to ignore falsey values. - } else { - yield child; - } - } - - yield `</${tag}>`; -} - -/** Astro‘s primary h() function. Allows it to use JSX-like syntax. */ -export async function h(tag: HTag, attrs: HProps, ...pChildren: Array<Promise<HChild>>) { - const children = await Promise.all(pChildren.flat(Infinity)); - if (typeof tag === 'function') { - // We assume it's an astro component - return tag(attrs, ...children); - } - - return Array.from(_h(tag, attrs, children)).join(''); -} - -/** Fragment helper, similar to React.Fragment */ -export function Fragment(_: HProps, ...children: Array<string>) { - return children.join(''); -} diff --git a/src/frontend/render/preact.ts b/src/frontend/render/preact.ts deleted file mode 100644 index 5c50b6fe3..000000000 --- a/src/frontend/render/preact.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { h, render, ComponentType } from 'preact'; -import { renderToString } from 'preact-render-to-string'; -import { childrenToVnodes } from './utils'; -import type { ComponentRenderer } from '../../@types/renderer'; -import { createRenderer } from './renderer'; - -// This prevents tree-shaking of render. -Function.prototype(render); - -const Preact: ComponentRenderer<ComponentType> = { - jsxPragma: h, - jsxPragmaName: 'h', - renderStatic(Component) { - return async (props, ...children) => { - return renderToString(h(Component, props, childrenToVnodes(h, children))); - }; - }, - imports: { - preact: ['render', 'Fragment', 'h'], - }, - render({ Component, root, props, children }) { - return `render(h(${Component}, ${props}, h(Fragment, null, ...${children})), ${root})`; - }, -}; - -const renderer = createRenderer(Preact); - -export const __preact_static = renderer.static; -export const __preact_load = renderer.load; -export const __preact_idle = renderer.idle; -export const __preact_visible = renderer.visible; diff --git a/src/frontend/render/react.ts b/src/frontend/render/react.ts deleted file mode 100644 index 51c0c9729..000000000 --- a/src/frontend/render/react.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { ComponentRenderer } from '../../@types/renderer'; -import React, { ComponentType } from 'react'; -import ReactDOMServer from 'react-dom/server'; -import { createRenderer } from './renderer'; -import { childrenToVnodes } from './utils'; - -const ReactRenderer: ComponentRenderer<ComponentType> = { - jsxPragma: React.createElement, - jsxPragmaName: 'React.createElement', - renderStatic(Component) { - return async (props, ...children) => { - return ReactDOMServer.renderToString(React.createElement(Component, props, childrenToVnodes(React.createElement, children))); - }; - }, - imports: { - react: ['default: React'], - 'react-dom': ['default: ReactDOM'], - }, - render({ Component, root, children, props }) { - return `ReactDOM.hydrate(React.createElement(${Component}, ${props}, React.createElement(React.Fragment, null, ...${children})), ${root})`; - }, -}; - -const renderer = createRenderer(ReactRenderer); - -export const __react_static = renderer.static; -export const __react_load = renderer.load; -export const __react_idle = renderer.idle; -export const __react_visible = renderer.visible; diff --git a/src/frontend/render/renderer.ts b/src/frontend/render/renderer.ts deleted file mode 100644 index a5cc9d581..000000000 --- a/src/frontend/render/renderer.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type { DynamicRenderContext, DynamicRendererGenerator, SupportedComponentRenderer, StaticRendererGenerator } from '../../@types/renderer'; -import { childrenToH } from './utils'; - -/** Initialize Astro Component renderer for Static and Dynamic components */ -export function createRenderer(renderer: SupportedComponentRenderer) { - const _static: StaticRendererGenerator = (Component) => renderer.renderStatic(Component); - const _imports = (context: DynamicRenderContext) => { - const values = Object.values(renderer.imports ?? {}) - .reduce((acc, v) => { - return [...acc, `{ ${v.join(', ')} }`]; - }, []) - .join(', '); - const libs = Object.keys(renderer.imports ?? {}) - .reduce((acc: string[], lib: string) => { - return [...acc, `import("${context.frameworkUrls[lib as any]}")`]; - }, []) - .join(','); - return `const [{${context.componentExport}: Component}, ${values}] = await Promise.all([import("${context.componentUrl}")${renderer.imports ? ', ' + libs : ''}]);`; - }; - const serializeProps = ({ children: _, ...props }: Record<string, any>) => JSON.stringify(props); - const createContext = () => { - const astroId = `${Math.floor(Math.random() * 1e16)}`; - return { ['data-astro-id']: astroId, root: `document.querySelector('[data-astro-id="${astroId}"]')`, Component: 'Component' }; - }; - const createDynamicRender: DynamicRendererGenerator = (wrapperStart, wrapperEnd) => (Component, renderContext) => { - const innerContext = createContext(); - return async (props, ...children) => { - let value: string; - try { - value = await _static(Component)(props, ...children); - } catch (e) { - value = ''; - } - value = `<div data-astro-id="${innerContext['data-astro-id']}" style="display:contents">${value}</div>`; - - const script = ` - ${typeof wrapperStart === 'function' ? wrapperStart(innerContext) : wrapperStart} - ${_imports(renderContext)} - ${renderer.render({ - ...innerContext, - props: serializeProps(props), - children: `[${childrenToH(renderer, children) ?? ''}]`, - childrenAsString: `\`${children}\``, - })} - ${typeof wrapperEnd === 'function' ? wrapperEnd(innerContext) : wrapperEnd} - `; - - return [value, `<script type="module">${script.trim()}</script>`].join('\n'); - }; - }; - - return { - static: _static, - load: createDynamicRender('(async () => {', '})()'), - idle: createDynamicRender('requestIdleCallback(async () => {', '})'), - visible: createDynamicRender( - 'const o = new IntersectionObserver(async ([entry]) => { if (!entry.isIntersecting) { return; } o.disconnect();', - ({ root }) => `}); Array.from(${root}.children).forEach(child => o.observe(child))` - ), - }; -} diff --git a/src/frontend/render/svelte.ts b/src/frontend/render/svelte.ts deleted file mode 100644 index 13e2b8f58..000000000 --- a/src/frontend/render/svelte.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { ComponentRenderer } from '../../@types/renderer'; -import type { SvelteComponent } from 'svelte'; -import { createRenderer } from './renderer'; -import SvelteWrapper from '../SvelteWrapper.svelte.server'; - -const SvelteRenderer: ComponentRenderer<SvelteComponent> = { - renderStatic(Component) { - return async (props, ...children) => { - const { html } = SvelteWrapper.render({ __astro_component: Component, __astro_children: children.join('\n'), ...props }); - return html; - }; - }, - imports: { - 'svelte-runtime': ['default: render'], - }, - render({ Component, root, props, childrenAsString }) { - return `render(${root}, ${Component}, ${props}, ${childrenAsString});`; - }, -}; - -const renderer = createRenderer(SvelteRenderer); - -export const __svelte_static = renderer.static; -export const __svelte_load = renderer.load; -export const __svelte_idle = renderer.idle; -export const __svelte_visible = renderer.visible; diff --git a/src/frontend/render/utils.ts b/src/frontend/render/utils.ts deleted file mode 100644 index 9d55626fe..000000000 --- a/src/frontend/render/utils.ts +++ /dev/null @@ -1,52 +0,0 @@ -import unified from 'unified'; -import parse from 'rehype-parse'; -import toH from 'hast-to-hyperscript'; -import { ComponentRenderer } from '../../@types/renderer'; -import moize from 'moize'; - -/** @internal */ -function childrenToTree(children: string[]) { - return children.map((child) => (unified().use(parse, { fragment: true }).parse(child) as any).children.pop()); -} - -/** - * Converts an HTML fragment string into vnodes for rendering via provided framework - * @param h framework's `createElement` function - * @param children the HTML string children - */ -export const childrenToVnodes = moize.deep(function childrenToVnodes(h: any, children: string[]) { - const tree = childrenToTree(children); - const vnodes = tree.map((subtree) => { - if (subtree.type === 'text') return subtree.value; - return toH(h, subtree); - }); - return vnodes; -}); - -/** - * Converts an HTML fragment string into h function calls as a string - * @param h framework's `createElement` function - * @param children the HTML string children - */ -export const childrenToH = moize.deep(function childrenToH(renderer: ComponentRenderer<any>, children: string[]): any { - if (!renderer.jsxPragma) return; - const tree = childrenToTree(children); - const innerH = (name: any, attrs: Record<string, any> | null = null, _children: string[] | null = null) => { - const vnode = renderer.jsxPragma?.(name, attrs, _children); - const childStr = _children ? `, [${_children.map((child) => serializeChild(child)).join(',')}]` : ''; - /* fix(react): avoid hard-coding keys into the serialized tree */ - if (attrs && attrs.key) attrs.key = undefined; - const __SERIALIZED = `${renderer.jsxPragmaName}("${name}", ${attrs ? JSON.stringify(attrs) : 'null'}${childStr})` as string; - return { ...vnode, __SERIALIZED }; - }; - const serializeChild = (child: unknown) => { - if (['string', 'number', 'boolean'].includes(typeof child)) return JSON.stringify(child); - if (child === null) return `null`; - if ((child as any).__SERIALIZED) return (child as any).__SERIALIZED; - return innerH(child).__SERIALIZED; - }; - return tree.map((subtree) => { - if (subtree.type === 'text') return JSON.stringify(subtree.value); - return toH(innerH, subtree).__SERIALIZED - }); -}); diff --git a/src/frontend/render/vue.ts b/src/frontend/render/vue.ts deleted file mode 100644 index 57c3c8276..000000000 --- a/src/frontend/render/vue.ts +++ /dev/null @@ -1,65 +0,0 @@ -import type { ComponentRenderer } from '../../@types/renderer'; -import type { Component as VueComponent } from 'vue'; -import { renderToString } from '@vue/server-renderer'; -import { defineComponent, createSSRApp, h as createElement } from 'vue'; -import { createRenderer } from './renderer'; - -// This prevents tree-shaking of render. -Function.prototype(renderToString); - -/** - * Users might attempt to use :vueAttribute syntax to pass primitive values. - * If so, try to JSON.parse them to get the primitives - */ -function cleanPropsForVue(obj: Record<string, any>) { - let cleaned = {} as any; - for (let [key, value] of Object.entries(obj)) { - if (key.startsWith(':')) { - key = key.slice(1); - if (typeof value === 'string') { - try { - value = JSON.parse(value); - } catch (e) {} - } - } - cleaned[key] = value; - } - return cleaned; -} - -const Vue: ComponentRenderer<VueComponent> = { - jsxPragma: createElement, - jsxPragmaName: 'createElement', - renderStatic(Component) { - return async (props, ...children) => { - const App = defineComponent({ - components: { - Component, - }, - data() { - return { props }; - }, - template: `<Component v-bind="props">${children.join('\n')}</Component>`, - }); - - const app = createSSRApp(App); - const html = await renderToString(app); - return html; - }; - }, - imports: { - vue: ['createApp', 'h: createElement'], - }, - render({ Component, root, props, children }) { - const vueProps = cleanPropsForVue(JSON.parse(props)); - return `const App = { render: () => createElement(${Component}, ${JSON.stringify(vueProps)}, { default: () => ${children} }) }; -createApp(App).mount(${root});`; - }, -}; - -const renderer = createRenderer(Vue); - -export const __vue_static = renderer.static; -export const __vue_load = renderer.load; -export const __vue_idle = renderer.idle; -export const __vue_visible = renderer.visible; diff --git a/src/frontend/runtime/svelte.ts b/src/frontend/runtime/svelte.ts deleted file mode 100644 index 78b6af6b6..000000000 --- a/src/frontend/runtime/svelte.ts +++ /dev/null @@ -1,10 +0,0 @@ -import SvelteWrapper from '../SvelteWrapper.svelte.client'; -import type { SvelteComponent } from 'svelte'; - -export default (target: Element, component: SvelteComponent, props: any, children: string) => { - new SvelteWrapper({ - target, - props: { __astro_component: component, __astro_children: children, ...props }, - hydrate: true, - }); -}; |