Enable lazy loading of modules
Currently all node modules need to be loaded at server start up for them to be wired up.
It might be nice to create some form of mechanism to enable lazy loading of modules, so they are only required when needed.
Interesting concept. We'd have to basically create some sort of dependency matching to the require file paths and then load them as modules require them? Ehh... I don't know... sounds terrible. I can't really think of an elegant way to handle something like that... not without major chances to the injection framework....
Possibly some kind of module loader that could be injected. The class that requires the service would just invoke the loader and fetch the service and then unload at the end.
That's all I got at the minute. No it doesn't sound very elegant. And not sure if it would provide any advantage in a web app with multiple connections loading and unloading modules.
Could be useful for a desktop app where a low overhead is more important..
Yeah. I've got to get on benchmarking this to see if having to load all the modules is really a performance issue or not. It's possible it's negligible? lol