Home / File/ factory.ts — astro Source File

factory.ts — astro Source File

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

File typescript CoreAstro RenderingEngine 3 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  32a4e48b_c12c_f5bf_8d17_818e77a145b7["factory.ts"]
  10d4e39f_edb6_3e34_aa93_ae1211e7da05["../types/public/internal.js"]
  32a4e48b_c12c_f5bf_8d17_818e77a145b7 --> 10d4e39f_edb6_3e34_aa93_ae1211e7da05
  fafd37f7_4f96_f4d7_ed97_94234c7e57aa["./astro/head-and-content.js"]
  32a4e48b_c12c_f5bf_8d17_818e77a145b7 --> fafd37f7_4f96_f4d7_ed97_94234c7e57aa
  02a6e2b4_7619_f2ac_ef3f_25cd47b88fe5["./astro/render-template.js"]
  32a4e48b_c12c_f5bf_8d17_818e77a145b7 --> 02a6e2b4_7619_f2ac_ef3f_25cd47b88fe5
  style 32a4e48b_c12c_f5bf_8d17_818e77a145b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { PropagationHint, SSRResult } from '../../../../types/public/internal.js';
import type { HeadAndContent, ThinHead } from './head-and-content.js';
import type { RenderTemplateResult } from './render-template.js';

export type AstroFactoryReturnValue = RenderTemplateResult | Response | HeadAndContent | ThinHead;

// The callback passed to $$createComponent
export interface AstroComponentFactory {
	(result: any, props: any, slots: any): AstroFactoryReturnValue | Promise<AstroFactoryReturnValue>;
	isAstroComponentFactory?: boolean;
	moduleId?: string | undefined;
	propagation?: PropagationHint;
}

export function isAstroComponentFactory(obj: any): obj is AstroComponentFactory {
	return obj == null ? false : obj.isAstroComponentFactory === true;
}

export function isAPropagatingComponent(
	result: SSRResult,
	factory: AstroComponentFactory,
): boolean {
	const hint = getPropagationHint(result, factory);
	return hint === 'in-tree' || hint === 'self';
}

export function getPropagationHint(
	result: SSRResult,
	factory: AstroComponentFactory,
): PropagationHint {
	let hint: PropagationHint = factory.propagation || 'none';
	if (factory.moduleId && result.componentMetadata.has(factory.moduleId) && hint === 'none') {
		hint = result.componentMetadata.get(factory.moduleId)!.propagation;
	}
	return hint;
}

Domain

Subdomains

Dependencies

  • ../types/public/internal.js
  • ./astro/head-and-content.js
  • ./astro/render-template.js

Frequently Asked Questions

What does factory.ts do?
factory.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 factory.ts?
factory.ts defines 3 function(s): getPropagationHint, isAPropagatingComponent, isAstroComponentFactory.
What does factory.ts depend on?
factory.ts imports 3 module(s): ../types/public/internal.js, ./astro/head-and-content.js, ./astro/render-template.js.
Where is factory.ts in the architecture?
factory.ts is located at packages/astro/src/runtime/server/render/astro/factory.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/runtime/server/render/astro).

Analyze Your Own Codebase

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

Try Supermodel Free