There are various JS modules that represent different OOP Classes, such as different types of backend tasks like SendEmailTask, WriteToDbTask, WriteToDiskTask, or different actions on a drawing canvas like DrawArc, DrawLine, DrawBezier. Each module is stored in its own JS file within a common directory.
In a client module that depends on all of these classes, the dependency list and argument list need to include each one separately. This can become cumbersome, especially when new modules are added to the set, resulting in constant updates to the code.
Are there ways to avoid these issues? One possible solution could be creating a namespace module where sub-modules depend on it and add their definitions to it. However, ensuring that the client loads after all the sub-modules might pose a challenge in this approach.
Another idea could be expressing dependencies and arguments using wildcards, such as 'tasks/*' for dependencies and an unknown placeholder for arguments.