Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fathym_atomic_icons/src/src.deps.ts>Plugin

Fathym's Atomic Icons is a library that supports the optimized creation of customzied icon sets for delivery via Deno Fresh.
Go to Latest
interface Plugin
import { type Plugin } from "https://deno.land/x/fathym_atomic_icons@v0.0.17/src/src.deps.ts";

Type Parameters

optional
State = Record<string, unknown>

Properties

name: string

The name of the plugin. Must be snake-case.

optional
entrypoints: Record<string, string>

A map of a snake-case names to a import specifiers. The entrypoints declared here can later be used in the "scripts" option of PluginRenderResult to load the entrypoint's code on the client.

optional
routes: PluginRoute[]
optional
middlewares: PluginMiddleware<State>[]
optional
islands: PluginIslands

Methods

optional
render(ctx: PluginRenderContext): PluginRenderResult

The render hook is called on the server every time some JSX needs to be turned into HTML. The render hook needs to call the ctx.render function exactly once.

The hook can return a PluginRenderResult object that can do things like inject CSS into the page, or load additional JS files on the client.

optional
renderAsync(ctx: PluginAsyncRenderContext): Promise<PluginRenderResult>

The asynchronous render hook is called on the server every time some JSX needs to be turned into HTML, wrapped around all synchronous render hooks. The render hook needs to call the ctx.renderAsync function exactly once, and await the result.

This is useful for when plugins are generating styles and scripts with asynchronous dependencies. Unlike the synchronous render hook, async render hooks for multiple pages can be running at the same time. This means that unlike the synchronous render hook, you can not use global variables to propagate state between the render hook and the renderer.

optional
buildStart(config: ResolvedFreshConfig): Promise<void> | void

Called before running the Fresh build task

optional
buildEnd(): Promise<void> | void

Called after completing the Fresh build task

optional
configResolved(config: ResolvedFreshConfig): Promise<void> | void

Called after configuration has been loaded