Closed johannes-vogel closed 1 year ago
Is this compatible with older cds versions? Otherwise this will need some version-check compatibility code.
The load_plugin of 7.2.0 does not seem to cover it: node_modules/@sap/cds/lib/plugins.js:39
function _load_plugin (name, impl, conf) {
plugins[name] = async() => {
// TODO support ESM plugins. But see cap/cds/pull/1838#issuecomment-1177200 !
const plugin = plugins[name] = require(impl)
if (DEBUG) log('[cds] - loaded plugin:', { impl: local(impl) })
if (plugin.activate) await plugin.activate(conf)
}
}
Is this compatible with older cds versions? Otherwise this will need some version-check compatibility code.
The load_plugin of 7.2.0 does not seem to cover it: node_modules/@sap/cds/lib/plugins.js:39
function _load_plugin (name, impl, conf) { plugins[name] = async() => { // TODO support ESM plugins. But see cap/cds/pull/1838#issuecomment-1177200 ! const plugin = plugins[name] = require(impl) if (DEBUG) log('[cds] - loaded plugin:', { impl: local(impl) }) if (plugin.activate) await plugin.activate(conf) } }
I also double checked and came to the same conclusion.
superseded by #32
The plugin mechanism is able to deal with asynchronous functions. Daniel would like to get rid of the
activate
function in general. This PR would already prepare for it.