summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar matthewp <matthewp@users.noreply.github.com> 2023-02-02 19:23:44 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2023-02-02 19:23:44 +0000
commit10550f5ee2f63fe0bba5a6f6533244a021b468ad (patch)
tree68daeed4977c5436972f094560684d5d44de3db8
parent9bec6bc410f324a41c67e5d185fa86f78d7625f2 (diff)
downloadastro-10550f5ee2f63fe0bba5a6f6533244a021b468ad.tar.gz
astro-10550f5ee2f63fe0bba5a6f6533244a021b468ad.tar.zst
astro-10550f5ee2f63fe0bba5a6f6533244a021b468ad.zip
[ci] format
-rw-r--r--packages/astro/src/runtime/server/jsx.ts4
-rw-r--r--packages/astro/src/runtime/server/render/astro/factory.ts2
-rw-r--r--packages/astro/src/runtime/server/render/head.ts2
-rw-r--r--packages/astro/src/runtime/server/render/slot.ts6
-rw-r--r--packages/astro/src/runtime/server/render/util.ts2
5 files changed, 10 insertions, 6 deletions
diff --git a/packages/astro/src/runtime/server/jsx.ts b/packages/astro/src/runtime/server/jsx.ts
index 365345a56..8b81a641e 100644
--- a/packages/astro/src/runtime/server/jsx.ts
+++ b/packages/astro/src/runtime/server/jsx.ts
@@ -11,8 +11,8 @@ import {
voidElementNames,
} from './index.js';
import { HTMLParts } from './render/common.js';
-import { ScopeFlags } from './render/util.js';
import type { ComponentIterable } from './render/component';
+import { ScopeFlags } from './render/util.js';
const ClientOnlyPlaceholder = 'astro-client-only';
@@ -95,7 +95,7 @@ Did you forget to import the component or is it possible there is a typo?`);
props[key] = value;
}
}
- result.scope |= ScopeFlags.JSX;
+ result.scope |= ScopeFlags.JSX;
return markHTMLString(await renderToString(result, vnode.type as any, props, slots));
}
case !vnode.type && (vnode.type as any) !== 0:
diff --git a/packages/astro/src/runtime/server/render/astro/factory.ts b/packages/astro/src/runtime/server/render/astro/factory.ts
index a1e7d0611..1f85fe45c 100644
--- a/packages/astro/src/runtime/server/render/astro/factory.ts
+++ b/packages/astro/src/runtime/server/render/astro/factory.ts
@@ -3,9 +3,9 @@ import type { HeadAndContent } from './head-and-content';
import type { RenderTemplateResult } from './render-template';
import { HTMLParts } from '../common.js';
+import { ScopeFlags } from '../util.js';
import { isHeadAndContent } from './head-and-content.js';
import { renderAstroTemplateResult } from './render-template.js';
-import { ScopeFlags } from '../util.js';
export type AstroFactoryReturnValue = RenderTemplateResult | Response | HeadAndContent;
diff --git a/packages/astro/src/runtime/server/render/head.ts b/packages/astro/src/runtime/server/render/head.ts
index 72be58623..0f39fe219 100644
--- a/packages/astro/src/runtime/server/render/head.ts
+++ b/packages/astro/src/runtime/server/render/head.ts
@@ -54,7 +54,7 @@ export function* maybeRenderHead(result: SSRResult) {
// Don't render the head inside of a JSX component that's inside of an Astro component
// as the Astro component will be the one to render the head.
- switch(result.scope) {
+ switch (result.scope) {
case ScopeFlags.JSX | ScopeFlags.Slot | ScopeFlags.Astro: {
return;
}
diff --git a/packages/astro/src/runtime/server/render/slot.ts b/packages/astro/src/runtime/server/render/slot.ts
index 1e2e946c3..32d0a2dc1 100644
--- a/packages/astro/src/runtime/server/render/slot.ts
+++ b/packages/astro/src/runtime/server/render/slot.ts
@@ -21,7 +21,11 @@ export function isSlotString(str: string): str is any {
return !!(str as any)[slotString];
}
-export async function renderSlot(result: SSRResult, slotted: string, fallback?: any): Promise<string> {
+export async function renderSlot(
+ result: SSRResult,
+ slotted: string,
+ fallback?: any
+): Promise<string> {
if (slotted) {
result.scope |= ScopeFlags.Slot;
let iterator = renderChild(slotted);
diff --git a/packages/astro/src/runtime/server/render/util.ts b/packages/astro/src/runtime/server/render/util.ts
index 3986f9d50..7e5ca9a5d 100644
--- a/packages/astro/src/runtime/server/render/util.ts
+++ b/packages/astro/src/runtime/server/render/util.ts
@@ -132,5 +132,5 @@ export function renderElement(
export const ScopeFlags = {
Astro: 1 << 0,
JSX: 1 << 1,
- Slot: 1 << 2
+ Slot: 1 << 2,
};