function ViewPlugin
Since 0.6.0
ViewPlugin(options?: ViewPluginOptions): IPlugin

Creates the ViewPlugin.

The plugin registers one engine under CAPABILITIES.VIEW and a view health indicator reporting the selected engine. The @Render decorator resolves the engine once at register() (the optionalDependencies edge on DecoratorPlugin is what makes that a contract rather than priority luck) and renderView resolves it per request — both entry points honor the same configured engine.

Examples

Example 1

import { createApplication } from '@setu-ts/kernel';
import { RuntimePlugin } from '@setu-ts/runtime';
import { ViewPlugin } from '@setu-ts/view-plugin';

const app = createApplication({
  plugins: [RuntimePlugin(), ViewPlugin()], // or ViewPlugin({ engine: 'hono-html' })
});

Parameters

optional
options: ViewPluginOptions

Engine selection; omit for the default 'hono-jsx' arm

Return Type

IPlugin

The plugin instance

Usage

import { ViewPlugin } from "view-plugin/src/index.ts";