CorePlugin

View source

ExtendsPlugin

Provides the core runtime foundation for an App.

Registering CorePlugin selects MainWorld as the app’s default world, stages the shared SchedulerBuilder.Instance scheduler, and sets defaultRunner as the app runner.

It creates the AppSchedule.Startup and AppSchedule.Update schedules. Both use the core phase ordering and default group. During startup, it also prepares the core and primitive type metadata used by the app’s reflection support.

CorePlugin requires ReflectPlugin. Register that plugin before the core plugin; registering the core plugin does not install it.

Examples

import { App, CorePlugin, ReflectPlugin } from 'wima'

const app = new App()
app
  .registerPlugin(new ReflectPlugin())
  .registerPlugin(new CorePlugin())
  .run()

Constructor


constructor()

Methods


register(app: App): void

View source

Configures the app during the registration phase of App#run.

PluginRegistry calls this hook for each registered plugin in insertion order, before it validates any Plugin#requires IDs. A hook can use the app’s registration methods to configure worlds and resources, install component hooks, and stage schedules with execution callbacks for the app runner. It can also call App#registerPlugin to add a nested plugin. The registry continues through plugins added during this pass, and those plugins also reach the later Plugin#finish pass. Return values are ignored.

Parameters

NameDescriptionDefault
app

App to configure.

—

Returns

This hook’s return value is ignored.

requires(): TypeId[]

View source

Returns plugin IDs that must already be registered before finalization.

App#run asks PluginRegistry to validate every returned ID after all registration hooks complete and before any finish hook runs. A missing ID causes run to throw; IDs do not cause plugins to be installed, and this list does not reorder plugin hooks. The base implementation has no dependencies.

Returns

Required plugin type IDs.