Considering deleting all page module files


#1

Ever since Ionic 3, every page has this .module.ts file which I derive ZERO utility from and I really don’t understand why it’s there or how it can make my application better. All it does is throw errors when I try to build my application and take up more file space. I wanted to ask -
Are there are any consequences that I will have if I delete all the page module files? How have you guys found them useful and if you didn’t find them useful, what did you do?


#2

No and “don’t use the CLI generators”. My fundamental issue is code duplication of components that are used in multiple lazily-loaded pages. If that ever gets resolved, I will revise my opinion.


#3

I delete each and every one


#4

Yup, I’m going to do this to avoid having a module.ts file created for every page and component that I create. But I’m just trying to wrap my head around why Ionic added this file to each page folder. Any ideas on what they were trying to achieve?


#5

It’s a long story. If you’re really interested, I would start here and then maybe go to here and here.

tl;dr: Everybody complained about long app startup times. This was an attempt to address that. Results were, shall we say, mixed.


#6

I’m wondering what size these apps were that were receiving complaints. I’ve put together a couple of whales, and have never had an app take a noticeably long time to load. And I have not once used the module.ts in a page.

Am I doing something right? Were people doing something wrong? Doing the work providers should be doing in their components? People just want faster faster faster? Or has Ionic addressed the load times outside of using the module.ts files as well?

I’m relatively new (a little less than a year) to Ionic