ReflectPlugin

View source

ExtendsPlugin

Adds a TypeRegistry resource to an App for plugins that register runtime type metadata.

During plugin registration, ReflectPlugin creates a fresh TypeRegistry and stages it with App#setResource. The app makes that resource available in its default world before the runner starts, so application code can retrieve it with world.getResource(TypeRegistry).

Plugins that register metadata for their components, resources, enums, or other runtime values depend on ReflectPlugin to use this shared registry. Register ReflectPlugin before those plugins; a missing dependency causes App#run to fail, and registering a plugin does not install its dependencies automatically.

Examples

import { App } from '@wimaengine/app'
import { CorePlugin } from '@wimaengine/core'
import { ReflectPlugin } from '@wimaengine/reflect'
import { TimePlugin } from '@wimaengine/time'

new App()
  .registerPlugin(new ReflectPlugin())
  .registerPlugin(new CorePlugin())
  .registerPlugin(new TimePlugin())
  .run()

Constructor


constructor()

Methods


register(app: App): void

View source

Parameters

NameDescriptionDefault
app

App to configure.

—