I've got a large scale single page app that I'm migrating to Dojo 1.7/AMD loader syntax.
I've got a main JSP that loads everything, and then a multitude of JSP pages that are used for dynamic content generation.
Is it a better design decision to add the require(){} block around the entire application, or around each instance of a requisite module?
Or some combination? Add the most common require()'s to the main page, and then go through and find other instances that need to be wrapped?
You should lazy-load as much as possible; perhaps at the "dynamic content" JSP page level. It makes it very clear about what each page requires, and keeping the requires() close to the code that uses the imported module is clearer.
It also reduces the amount of time the main page takes to load, which means the user can interact with the application in a shorter amount of time. This is a Good Thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With