Hello fellow Ionites
I’m confused regarding best practices regarding best-practices on lazy-loading, component grouping in modules.
I’ve been with Ionic since early Beta, and I have seen the CLI changing in the way it makes components and pages. It has gone from creating ‘bare’ pages, to lazy-loading pages and each page in its own module. And creating ‘bare’ components and a single module per component, and now a single module with for all components.
So I’m really confused…
What is the best practice for using pages, lazy-loading pages, and components regarding performance but also code duplication?
Shall I stick every page to be in its own module and lazy-loaded? Then each component in its own module that can be imported to root component and each page component? or group components to a single module and import everywhere?
Or totally avoid lazy-loading and have all pages declared in my root app component?
We are building an app that constantly evolves and pages and components are added, and I would like to stick to best practice. Avoid large refactors in the future or see it having degraded performance because or ‘early’ bad practices…
Any suggestion, comment from more experienced members of this forums appreciated.
Thank you in advance.