-
Notifications
You must be signed in to change notification settings - Fork 0
Migration: v3
This version contains breaking API changes as well as a few other improvements. Here is a comprehensive guide on what to change in order to upgrade. If anything is missing, please file an issue.
The TypeScript interface definitions for units have been renamed and simplified, here is a mapping from the old names to the new ones:
-
LeverageUnit
->Unit
-
LeverageConfig
->Config
-
LeverageInstance
->Instance
-
LeverageConfigInstanceWithDependencies
->ConfigInstance
-
PluginInstanceWithDependencies
->PluginInstance
-
ServiceInstanceWithDependencies
->ServiceInstance
-
ComponentInstanceWithDependencies
->ComponentInstance
-
MiddlewareInstanceWithDependencies
->MiddlewareInstance
-
PluginConfigWithDependencies
->PluginConfigInstance
-
ServiceConfigWithDependencies
->ServiceConfigInstance
-
ComponentConfigWithDependencies
->ComponentConfigInstance
-
MiddlewareConfigWithDependencies
->MiddlewareConfigInstance
Finally! You no longer have to supply a config
property on your units!
v2
{
config: {
type: '...'
}
}
v3
{
type: '...'
}
The component type has been moved from component.config.type
to component.type
.
v2
{
config: {
type: '...'
}
}
v3
{
type: '...'
}
The plugin type has been moved from plugin.config.type
to plugin.type
.
v2
{
config: {
type: '...'
}
}
v3
{
type: '...'
}
The middleware type has been moved from middleware.config.type
to middleware.type
.
v2
{
config: {
type: '...'
}
}
v3
{
type: '...'
}
The service name has been moved from service.config.name
to service.name
.
v2
{
config: {
name: '...'
}
}
v3
{
name: '...'
}
The decorator pattern has been removed and replaced with a class that can be instantiated or extended for each unit.
v2
import { Component } from '@leverage/core';
@Component
class C {}
v3
import { Component } from '@leverage/core';
class C extends Component {}