Changelog - 2026-09-10
@configuration class artifact and type-safe component options
FeatureIn one line. Configuration classes run first and in a deterministic order, and component options are type-checked at registration.
What changed
@configuration. A class extendingBaseConfigurationruns before datasources and components, and can use@provideto supply values for other artifacts.- Ordering. Declare dependencies with
after: [ConfigA]. Siblings without dependencies run sorted by class name. A cycle throws at boot withDependency cycle detected in configurations: .... - Boot order. Configurations run at
REGISTER_CONFIGURATIONS, beforeREGISTER_DATA_SOURCESandREGISTER_COMPONENTS. - Typed options.
application.component<Base, Options>()andapplication.dataSource<Base, Options>()type-checkoptionsagainst the class'sConfigurableOptionsgeneric and pass them toinstance.configure(options).TMixinOptsgainsoptions?: Options.
ts
@configuration({ after: [DatabaseConfiguration] })
export class CacheConfiguration extends BaseConfiguration {
override setup(): void {
// Guaranteed to execute after DatabaseConfiguration
}
}
application.component(MailComponent, {
options: { provider: 'amazon-ses', config: { region: 'ap-southeast-1' } },
});Who is affected
- Everyone. Additive. No action needed.