Hey all,
I have been using AMD for a while now and have been searching for the best to solution to handling AMD in large, javascript heavy, multi page web apps. I have written a plugin which I'd love to get some feedback on.
The basic idea is to pass the required modules for any given page via a body tag attribute. The modules can return public properties which can be accessed from main.js and key/value arguments can be passed to the modules via the attribute tag. This approach has given me a lot of flexibility in modular design and code sharing throughout multi page applications.
Example body attribute specifying two modules to load, one with key/value arguments
<body data-route="sidebar social?type:twitter,something:somethingelse">
What do you guys think? :)