Lazy loading option
Would be a handy feature to enable/disable components for lazy loading (registering in the router, creating local NgModule).
Hi @berchik, Thank you for your feedback. To be able to understand fully this request, could you please provide us more information, as a specific use case you have and how this feature will help you going through it?
Hi @elena-gancheva, Ok, in order to explain a little I can say that since a smooth operating app is a challenge with NS on Android I’ve tried few things. Packing with Webpack helped, and using a worker for all my db management also helped much. I want to try lazy loading in hope of a better startup time, but need to be sure the payment on the first-time page navigation is not high.
So I’ve looked into the lazy loading process and it is simple enough but requires managing a lot of boilerplate code. This can be quite tedious when having dozens of components, especially if needed to be tested and then undo some or all.
It seems like a logical and quite helpful addition to sidekick - having a list of the components taken from the root router configuration, with checkmarks which can be checked or unchecked to make a specific component lazy load or not. It might encourage developers to use lazy loading which is probably a good practice with NS+Angular.
If checked, the application router configuration will register that component with “loadChildren” and add a local router & module in that component’s folder using the “forChild” method, and local route. Un-checking will reverse the process.
Hope this helps.
Hi @berchik, Thank you for the detailed use case description. We will discuss it and consider it for one of our future releases.