Home / File/ container.ts — astro Source File

container.ts — astro Source File

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

File typescript CoreAstro RenderingEngine 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  8c4b3e40_f678_1874_cdc1_328ccf3f9cee["container.ts"]
  4c453c0b_17bb_ebc3_f7de_e2a632e42c1e["../types/public/integrations.js"]
  8c4b3e40_f678_1874_cdc1_328ccf3f9cee --> 4c453c0b_17bb_ebc3_f7de_e2a632e42c1e
  10d4e39f_edb6_3e34_aa93_ae1211e7da05["../types/public/internal.js"]
  8c4b3e40_f678_1874_cdc1_328ccf3f9cee --> 10d4e39f_edb6_3e34_aa93_ae1211e7da05
  style 8c4b3e40_f678_1874_cdc1_328ccf3f9cee fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { AstroRenderer } from '../types/public/integrations.js';
import type { SSRLoadedRenderer } from '../types/public/internal.js';

/**
 * Use this function to provide renderers to the `AstroContainer`:
 *
 * ```js
 * import { getContainerRenderer } from "@astrojs/react";
 * import { experimental_AstroContainer as AstroContainer } from "astro/container";
 * import { loadRenderers } from "astro:container"; // use this only when using vite/vitest
 *
 * const renderers = await loadRenderers([ getContainerRenderer ]);
 * const container = await AstroContainer.create({ renderers });
 *
 * ```
 * @param renderers
 */
export async function loadRenderers(renderers: AstroRenderer[]) {
	const loadedRenderers = await Promise.all(
		renderers.map(async (renderer) => {
			const mod = await import(renderer.serverEntrypoint.toString());
			if (typeof mod.default !== 'undefined') {
				return {
					...renderer,
					ssr: mod.default,
				} as SSRLoadedRenderer;
			}
			return undefined;
		}),
	);

	return loadedRenderers.filter((r): r is SSRLoadedRenderer => Boolean(r));
}

Domain

Subdomains

Functions

Dependencies

  • ../types/public/integrations.js
  • ../types/public/internal.js

Frequently Asked Questions

What does container.ts do?
container.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 container.ts?
container.ts defines 1 function(s): loadRenderers.
What does container.ts depend on?
container.ts imports 2 module(s): ../types/public/integrations.js, ../types/public/internal.js.
Where is container.ts in the architecture?
container.ts is located at packages/astro/src/virtual-modules/container.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/virtual-modules).

Analyze Your Own Codebase

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

Try Supermodel Free