A great solution for managing modules is a module-loading framework. One popular choice is RequireJS, which is commonly used with the Dojo Toolkit. RequireJS utilizes the AMD (Asynchronous Module Definition) loader to automatically handle dependencies and allow you to define your own modules.
For those familiar with other programming languages, think of require
as the equivalent of import
or #include
, but in a web context, it operates asynchronously. This asynchronous approach simplifies management by making dependencies explicit rather than implicit, eliminating concerns about the order of javascript files.