Open Kaffiend opened 6 years ago
This behavior comes from the upstream repository that I forked. I had nothing to do with it.
What's happening is it bootstraps the root module, and then waits for the browser idle event. When the browser is idle it loads all the additional modules in the background. This has the advantage that when the user navigates to a lazy-loaded module it will be pre-loaded, but without delaying the overall start time of the application.
Right, I understand that and agree to the advantages, but should there be some explanation perhaps in a comment above the router configuration for less experienced seed users? It could be misleading seeing a lazy loaded module's state in the dev tools when they haven't actually called that module yet. I'm speaking strictly from a state management point of view obviously, and there comes a point in larger scale applications when full asynchronous state is more of a requirement...or luxury.
Edit: Please don't misunderstand me, i'm not trying to nit pick. These are just things i notice having a team comprised of different skill levels in the same stack. Things i find, helpful and time saving as things progress.
Yeah, I had a discussion a while ago with the folks from AngularClass because I thought it was a bug all the modules where loading at once. PR welcome to explain this in the documentation.
Absolutely, not a problem.
[ *] question about the decisions made in the repository
PreloadAllModules
. What is purpose of this when demonstrating lazy loaded modules? Yes technically they are still lazy loaded after initial load. but when managing state of an application and state is loaded asynchronously this kind of defeats the purpose doesn't it? All modules not protected by aCanLoad
guard will be loaded immediately.Please refer to this question on NGRX