diff --git a/packages/astro/src/runtime/server/render/common.ts b/packages/astro/src/runtime/server/render/common.ts index a49bb2c9dd..d4c7a12426 100644 --- a/packages/astro/src/runtime/server/render/common.ts +++ b/packages/astro/src/runtime/server/render/common.ts @@ -1,7 +1,6 @@ import type { SSRResult } from '../../../@types/astro'; import type { RenderInstruction } from './instruction.js'; -import { isRenderInstruction } from './instruction.js'; import { HTMLBytes, HTMLString, markHTMLString } from '../escape.js'; import { determineIfNeedsHydrationScript, @@ -10,6 +9,7 @@ import { type PrescriptType, } from '../scripts.js'; import { renderAllHeadContent } from './head.js'; +import { isRenderInstruction } from './instruction.js'; import { isSlotString, type SlotString } from './slot.js'; /** @@ -65,8 +65,8 @@ function stringifyChunk( let prescriptType: PrescriptType = needsHydrationScript ? 'both' : needsDirectiveScript - ? 'directive' - : null; + ? 'directive' + : null; if (prescriptType) { let prescripts = getPrescripts(result, prescriptType, hydration.directive); return markHTMLString(prescripts); diff --git a/packages/astro/src/runtime/server/render/head.ts b/packages/astro/src/runtime/server/render/head.ts index d56684ce58..d2cb43fa3c 100644 --- a/packages/astro/src/runtime/server/render/head.ts +++ b/packages/astro/src/runtime/server/render/head.ts @@ -1,8 +1,8 @@ import type { SSRResult } from '../../../@types/astro'; import { markHTMLString } from '../escape.js'; -import { createRenderInstruction } from './instruction.js'; import type { MaybeRenderHeadInstruction, RenderHeadInstruction } from './instruction.js'; +import { createRenderInstruction } from './instruction.js'; import { renderElement } from './util.js'; // Filter out duplicate elements in our set diff --git a/packages/astro/src/runtime/server/render/index.ts b/packages/astro/src/runtime/server/render/index.ts index c7e39e70a0..da83879e0d 100644 --- a/packages/astro/src/runtime/server/render/index.ts +++ b/packages/astro/src/runtime/server/render/index.ts @@ -1,10 +1,10 @@ export type { AstroComponentFactory, AstroComponentInstance } from './astro/index'; -export type { RenderInstruction } from './instruction'; export { createHeadAndContent, renderTemplate, renderToString } from './astro/index.js'; export { Fragment, Renderer, chunkToByteArray, chunkToString } from './common.js'; export { renderComponent, renderComponentToString } from './component.js'; export { renderHTMLElement } from './dom.js'; export { maybeRenderHead, renderHead } from './head.js'; +export type { RenderInstruction } from './instruction'; export { renderPage } from './page.js'; export { renderSlot, renderSlotToString, type ComponentSlots } from './slot.js'; export { renderScriptElement, renderUniqueStylesheet } from './tags.js'; diff --git a/packages/astro/src/runtime/server/render/instruction.ts b/packages/astro/src/runtime/server/render/instruction.ts index 5cda5cec99..d8feacff96 100644 --- a/packages/astro/src/runtime/server/render/instruction.ts +++ b/packages/astro/src/runtime/server/render/instruction.ts @@ -20,13 +20,19 @@ export type RenderInstruction = | RenderHeadInstruction | MaybeRenderHeadInstruction; -export function createRenderInstruction(instruction: RenderDirectiveInstruction): RenderDirectiveInstruction; +export function createRenderInstruction( + instruction: RenderDirectiveInstruction +): RenderDirectiveInstruction; export function createRenderInstruction(instruction: RenderHeadInstruction): RenderHeadInstruction; -export function createRenderInstruction(instruction: MaybeRenderHeadInstruction): MaybeRenderHeadInstruction; +export function createRenderInstruction( + instruction: MaybeRenderHeadInstruction +): MaybeRenderHeadInstruction; export function createRenderInstruction(instruction: { type: string }): RenderInstruction { - return Object.defineProperty(instruction as RenderInstruction, RenderInstructionSymbol, { value: true }); + return Object.defineProperty(instruction as RenderInstruction, RenderInstructionSymbol, { + value: true, + }); } export function isRenderInstruction(chunk: any): chunk is RenderInstruction { - return chunk && typeof chunk === 'object' && chunk[RenderInstructionSymbol]; + return chunk && typeof chunk === 'object' && chunk[RenderInstructionSymbol]; }