sidekick-feedback icon indicating copy to clipboard operation
sidekick-feedback copied to clipboard

Lazy loading option

Open berchik opened this issue 8 years ago • 3 comments

Would be a handy feature to enable/disable components for lazy loading (registering in the router, creating local NgModule).

berchik avatar Aug 30 '17 15:08 berchik

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?

elena-gancheva avatar Aug 31 '17 10:08 elena-gancheva

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.

berchik avatar Sep 03 '17 12:09 berchik

Hi @berchik, Thank you for the detailed use case description. We will discuss it and consider it for one of our future releases.

elena-gancheva avatar Sep 04 '17 13:09 elena-gancheva