mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
[ci] format
This commit is contained in:
parent
b12c8471f4
commit
821918bc0c
4 changed files with 15 additions and 9 deletions
|
@ -1,7 +1,6 @@
|
||||||
import type { SSRResult } from '../../../@types/astro';
|
import type { SSRResult } from '../../../@types/astro';
|
||||||
import type { RenderInstruction } from './instruction.js';
|
import type { RenderInstruction } from './instruction.js';
|
||||||
|
|
||||||
import { isRenderInstruction } from './instruction.js';
|
|
||||||
import { HTMLBytes, HTMLString, markHTMLString } from '../escape.js';
|
import { HTMLBytes, HTMLString, markHTMLString } from '../escape.js';
|
||||||
import {
|
import {
|
||||||
determineIfNeedsHydrationScript,
|
determineIfNeedsHydrationScript,
|
||||||
|
@ -10,6 +9,7 @@ import {
|
||||||
type PrescriptType,
|
type PrescriptType,
|
||||||
} from '../scripts.js';
|
} from '../scripts.js';
|
||||||
import { renderAllHeadContent } from './head.js';
|
import { renderAllHeadContent } from './head.js';
|
||||||
|
import { isRenderInstruction } from './instruction.js';
|
||||||
import { isSlotString, type SlotString } from './slot.js';
|
import { isSlotString, type SlotString } from './slot.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,8 +65,8 @@ function stringifyChunk(
|
||||||
let prescriptType: PrescriptType = needsHydrationScript
|
let prescriptType: PrescriptType = needsHydrationScript
|
||||||
? 'both'
|
? 'both'
|
||||||
: needsDirectiveScript
|
: needsDirectiveScript
|
||||||
? 'directive'
|
? 'directive'
|
||||||
: null;
|
: null;
|
||||||
if (prescriptType) {
|
if (prescriptType) {
|
||||||
let prescripts = getPrescripts(result, prescriptType, hydration.directive);
|
let prescripts = getPrescripts(result, prescriptType, hydration.directive);
|
||||||
return markHTMLString(prescripts);
|
return markHTMLString(prescripts);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import type { SSRResult } from '../../../@types/astro';
|
import type { SSRResult } from '../../../@types/astro';
|
||||||
|
|
||||||
import { markHTMLString } from '../escape.js';
|
import { markHTMLString } from '../escape.js';
|
||||||
import { createRenderInstruction } from './instruction.js';
|
|
||||||
import type { MaybeRenderHeadInstruction, RenderHeadInstruction } from './instruction.js';
|
import type { MaybeRenderHeadInstruction, RenderHeadInstruction } from './instruction.js';
|
||||||
|
import { createRenderInstruction } from './instruction.js';
|
||||||
import { renderElement } from './util.js';
|
import { renderElement } from './util.js';
|
||||||
|
|
||||||
// Filter out duplicate elements in our set
|
// Filter out duplicate elements in our set
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
export type { AstroComponentFactory, AstroComponentInstance } from './astro/index';
|
export type { AstroComponentFactory, AstroComponentInstance } from './astro/index';
|
||||||
export type { RenderInstruction } from './instruction';
|
|
||||||
export { createHeadAndContent, renderTemplate, renderToString } from './astro/index.js';
|
export { createHeadAndContent, renderTemplate, renderToString } from './astro/index.js';
|
||||||
export { Fragment, Renderer, chunkToByteArray, chunkToString } from './common.js';
|
export { Fragment, Renderer, chunkToByteArray, chunkToString } from './common.js';
|
||||||
export { renderComponent, renderComponentToString } from './component.js';
|
export { renderComponent, renderComponentToString } from './component.js';
|
||||||
export { renderHTMLElement } from './dom.js';
|
export { renderHTMLElement } from './dom.js';
|
||||||
export { maybeRenderHead, renderHead } from './head.js';
|
export { maybeRenderHead, renderHead } from './head.js';
|
||||||
|
export type { RenderInstruction } from './instruction';
|
||||||
export { renderPage } from './page.js';
|
export { renderPage } from './page.js';
|
||||||
export { renderSlot, renderSlotToString, type ComponentSlots } from './slot.js';
|
export { renderSlot, renderSlotToString, type ComponentSlots } from './slot.js';
|
||||||
export { renderScriptElement, renderUniqueStylesheet } from './tags.js';
|
export { renderScriptElement, renderUniqueStylesheet } from './tags.js';
|
||||||
|
|
|
@ -20,13 +20,19 @@ export type RenderInstruction =
|
||||||
| RenderHeadInstruction
|
| RenderHeadInstruction
|
||||||
| MaybeRenderHeadInstruction;
|
| MaybeRenderHeadInstruction;
|
||||||
|
|
||||||
export function createRenderInstruction(instruction: RenderDirectiveInstruction): RenderDirectiveInstruction;
|
export function createRenderInstruction(
|
||||||
|
instruction: RenderDirectiveInstruction
|
||||||
|
): RenderDirectiveInstruction;
|
||||||
export function createRenderInstruction(instruction: RenderHeadInstruction): RenderHeadInstruction;
|
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 {
|
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 {
|
export function isRenderInstruction(chunk: any): chunk is RenderInstruction {
|
||||||
return chunk && typeof chunk === 'object' && chunk[RenderInstructionSymbol];
|
return chunk && typeof chunk === 'object' && chunk[RenderInstructionSymbol];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue