summaryrefslogtreecommitdiff
path: root/packages/integrations/preact/src/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/preact/src/server.ts')
-rw-r--r--packages/integrations/preact/src/server.ts16
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/integrations/preact/src/server.ts b/packages/integrations/preact/src/server.ts
index 2c1ac738a..212e183cf 100644
--- a/packages/integrations/preact/src/server.ts
+++ b/packages/integrations/preact/src/server.ts
@@ -1,9 +1,9 @@
-import type { AstroPreactAttrs, RendererContext } from './types';
-import { h, Component as BaseComponent } from 'preact';
+import { Component as BaseComponent, h } from 'preact';
import render from 'preact-render-to-string';
-import StaticHtml from './static-html.js';
import { getContext } from './context.js';
import { restoreSignalsOnProps, serializeSignals } from './signals.js';
+import StaticHtml from './static-html.js';
+import type { AstroPreactAttrs, RendererContext } from './types';
const slotName = (str: string) => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase());
@@ -38,7 +38,12 @@ function check(this: RendererContext, Component: any, props: Record<string, any>
}
}
-function renderToStaticMarkup(this: RendererContext, Component: any, props: Record<string, any>, { default: children, ...slotted }: Record<string, any>) {
+function renderToStaticMarkup(
+ this: RendererContext,
+ Component: any,
+ props: Record<string, any>,
+ { default: children, ...slotted }: Record<string, any>
+) {
const ctx = getContext(this.result);
const slots: Record<string, ReturnType<typeof h>> = {};
@@ -60,11 +65,10 @@ function renderToStaticMarkup(this: RendererContext, Component: any, props: Reco
);
return {
attrs,
- html
+ html,
};
}
-
/**
* Reduces console noise by filtering known non-problematic errors.
*