WireBox allows mixing in of methods into a component. We can leverage this to mix in arbitrary new collection methods when loading the module. Think of it like the static macros available in Lucee 5 already.
Here’s how I envision it: add a custom setting macrosLocation which takes a string, list, or array of locations. Then, in ModuleConfig.cfc@onLoad mix in those locations to the mapping for Collection.
(This would obviously only be an automatic feature for ColdBox users.)
Don’t forget to add the feature to the README.
As far as testing goes, we could pull in the integration testing scaffolding from cb-module-template so we can test the entire module lifecycle (including onLoad). I’m happy to help with that, if needed.
WireBox allows mixing in of methods into a component. We can leverage this to mix in arbitrary new collection methods when loading the module. Think of it like the static
macros
available in Lucee 5 already.Here’s how I envision it: add a custom setting
macrosLocation
which takes a string, list, or array of locations. Then, inModuleConfig.cfc@onLoad
mix in those locations to the mapping forCollection
.(This would obviously only be an automatic feature for ColdBox users.)
Don’t forget to add the feature to the README.
As far as testing goes, we could pull in the integration testing scaffolding from
cb-module-template
so we can test the entire module lifecycle (includingonLoad
). I’m happy to help with that, if needed.