Ionic 3: When to use lazy-loading and when not to?


#1

With Ionic 3 out (well, no announcement or anything, but if you start a new project right now you alread get v3 - I consider this released) there is this new thing lazy loading. This means you can decide not to load some or all page components on startup of the app, but only when the component is actually used (Correct?).

(Most information seems to be in here right now: https://docs.google.com/document/d/1vGokwMXPQItZmTHZQbTO4qwj_SQymFhRS_nJmiH0K3w/edit)

Now of course I have the question:
When should I lazy load a page and when should I load a page the old way?


#2

My opinion is that you should only venture into lazy loading if you have a bunch of completely independent pages that share only providers. If your pages share much in the way of custom components, they will get duplicated and you may actually see a backlash in terms of app package bloat.


#3

You can eager load components and pipes in app.module. And lazy load all pages. Taking a middle road between the lazy and eager. That would remove code duplication as well. But increase code complexity.