Home / File/ instruction.ts — astro Source File

instruction.ts — astro Source File

Architecture documentation for instruction.ts, a typescript file in the astro codebase. 1 imports, 0 dependents.

File typescript CoreAstro RenderingEngine 1 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  01544602_93cc_6e25_68ef_23ba3787e171["instruction.ts"]
  c82deda8_a7f2_ba3c_3d60_567e16167865["../hydration.js"]
  01544602_93cc_6e25_68ef_23ba3787e171 --> c82deda8_a7f2_ba3c_3d60_567e16167865
  style 01544602_93cc_6e25_68ef_23ba3787e171 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { HydrationMetadata } from '../hydration.js';

const RenderInstructionSymbol = Symbol.for('astro:render');

export type RenderDirectiveInstruction = {
	type: 'directive';
	hydration: HydrationMetadata;
};

export type RenderHeadInstruction = {
	type: 'head';
};

/**
 * Render a renderer-specific hydration script before the first component of that
 * framework
 */
export type RendererHydrationScriptInstruction = {
	type: 'renderer-hydration-script';
	rendererName: string;
	render: () => string;
};

export type MaybeRenderHeadInstruction = {
	type: 'maybe-head';
};

export type ServerIslandRuntimeInstruction = {
	type: 'server-island-runtime';
};

export type RenderScriptInstruction = {
	type: 'script';
	id: string;
	content: string;
};

export type RenderInstruction =
	| RenderDirectiveInstruction
	| RenderHeadInstruction
	| MaybeRenderHeadInstruction
	| RendererHydrationScriptInstruction
	| ServerIslandRuntimeInstruction
	| RenderScriptInstruction;

export function createRenderInstruction<T extends RenderInstruction>(instruction: T): T {
	return Object.defineProperty(instruction as T, RenderInstructionSymbol, {
		value: true,
	});
}

export function isRenderInstruction(chunk: any): chunk is RenderInstruction {
	return chunk && typeof chunk === 'object' && chunk[RenderInstructionSymbol];
}

Domain

Subdomains

Dependencies

  • ../hydration.js

Frequently Asked Questions

What does instruction.ts do?
instruction.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in instruction.ts?
instruction.ts defines 2 function(s): createRenderInstruction, isRenderInstruction.
What does instruction.ts depend on?
instruction.ts imports 1 module(s): ../hydration.js.
Where is instruction.ts in the architecture?
instruction.ts is located at packages/astro/src/runtime/server/render/instruction.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/runtime/server/render).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free