Core
The Core package is a functionality composed by other utilities that brings the minimum tools required to create a plugin. It exposes an API using helpers that are accessible using the coreKernel, implemented by the @orion/core module.
Packages |
Description |
---|---|
Responsible to handle deprecations alerts |
|
Responsible to manage dependency injection |
|
Responsible to fire Redux's actions |
|
Responsible to throw application errors |
|
Responsible to manage the globals of the application |
|
Responsible to define, use and run a set of functionalities |
|
Responsible to manage interactions with the plugins |
|
Responsible to deal with Redux's selectors |
|
Responsible to handle Redux's store data |
|
Responsible to give factories for dependency injection |
Definitions summary
This module produces Action Creators and Selectors definitions by default to be consumed on the plugins, but you can also produce Action Handlers at plugin level to be consumed by itself or other plugins:
Action Creators
"orion": {
"dispatchersHelper": {
"actionCreators": {
"produces": [
"pluginAdded",
"pluginShutdown",
"pluginStarted",
"startPlugin",
"shutdownPlugin",
],
}
}
}
Selectors
"orion": {
"selectorsHelper": {
"selectorFactories": {
"produces": [
"existsPlugin",
"getAllPluginsByPriority"
"getAllPluginsName",
"getPlugin",
"getPluginProperty",
"isPluginOn",
"isPluginPrefersOn",
],
}
}
}
Example
To consume any of those definitions you should specify them on your plugin's metadata.
Important: Use only the ones your plugin really needs.
{
"name": "my-plugin",
"version": "1.0.0",
"pluginDependencies": { "action-handler-plugin": "1.0.0" },
"orion": {
"selectorsHelper": {
"selectorFactories": {
"consumes": { "@orion/core": ["isPluginOn"] }
}
},
"dispatchersHelper": {
"actionCreators": {
"consumes": { "@orion/core": ["startPlugin"] }
}
},
"storeHelper": {
"actionHandlers": {
"consumes": { "action-handler-plugin": ["myHandlerAction"] }
}
}
}
}
{
"name": "action-handler-plugin",
"version": "1.0.0",
"orion": {
"storeHelper": {
"actionHandlers": {
"produces": ["myHandleAction"]
}
}
}
}