Lazy-loading modules


#1

I’ve not found too much information online on how to lazy-load AMD modules in ember. I’ve created a portal app that will load itself and then once loaded it will start loading the remaining modules. This provides a quick “pop” of the application on the screen for perceived performance while loading the remaining non-urgent modules.

I read on the site that there’s a “pod” way of architecting the solution, which totally jives with the approach I’m trying to build. Here’s my solution and problem that I’m running into:

  1. Use RequireJS to build the main skeleton app and the sub-modules.
  2. Once the sub-modules are loaded I can navigate to their pages
  3. Problem is that I have to use “deferReadiness” and “advanceReadiness” once the module loads in order to get this to work correctly, which nullifies the approach.

Is there something that I can do today to get this to work? Is there something coming out soon in EmberJS 2.0 such that I shouldn’t worry too much? Please help, I’ve asked this question many times on freenode and even hit up TomDale and Yehuda on twitter, but I’m sure they’re pretty busy as I haven’t gotten any responses yet.

Thanks for any guidance and help!

Sam


#2

I would also like to mention that I’d love for this option to be build system neutral such that I could use ember-cli or my own custom grunt tasks to achieve the same goal.