The current mechanism used to register both tasks and actions unnecessarily leaks internal API details to plugins. The requirement for users to register tasks by instantiating them directly and for plugins to absorb repetitive boilerplate code that can be better internalized when plugins are read.
As such, this PR simplifies the plugin registration to an object literal with the following structure:
import FooTask from './tasks/foo-task.js';
import { evaluateActions as evaluateFooActions } from './actions/foo-actions.js';
export default {
tasks: {
'foo': FooTask,
},
actions: {
'foo': evaluateFooActions,
}
};
The above means that you simply need to import a task/action, and re-export it in the object literal format provided.
The current mechanism used to register both tasks and actions unnecessarily leaks internal API details to plugins. The requirement for users to register tasks by instantiating them directly and for plugins to absorb repetitive boilerplate code that can be better internalized when plugins are read.
As such, this PR simplifies the plugin registration to an object literal with the following structure:
The above means that you simply need to import a task/action, and re-export it in the object literal format provided.