Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement .module for entities in Ionic #550

Open
jdiazgon opened this issue Apr 12, 2018 · 4 comments
Open

Implement .module for entities in Ionic #550

jdiazgon opened this issue Apr 12, 2018 · 4 comments
Assignees

Comments

@jdiazgon
Copy link
Member

In the Ionic templates, our colleagues implemented a .module (NgModule) class for our input entity, as shown below:

image

One of the main advantages of it is that modules can be loaded eagerly when the application starts or lazy loaded asynchronously by the router. More information here.

@maybeec said that this should be removed, because it is actually not being used in any part of the code. However, I create this issue just in case we may want to add it in the future. What do you think @sjimenez77?

@sjimenez77
Copy link
Member

sjimenez77 commented Apr 12, 2018

We have decided to distribute the generated files by Cobigen in the Ionic default folders (pages, providers, etc.) and import all of them in the main app module (the one that imports IonicModule). The question here is do we want to lazy load the pages generated by Cobigen or not?

From my point of view, it is not necessary for the moment for this first version. But I agree with @jdiazgon about future use cases: if big Ionic apps are developed using Cobigen, it will be mandatory to speed up boot times. Maybe a different checkbox for Cobigen generator wizard? One for common pages and another one for lazy loading pages?

In order to lazy load the generated page by Cobigen we will need to do the following:

  1. Add a <entity-name>.module.ts file inside the pages folder next to the <entity-name> components that uses the IonicPageModule.
  2. Declare the <entity-name>-list and <entity-name>-detail classes in this module.
  3. Therefore, instead of declaring the previous classes in the main app module, we will need to import the <entity-name>.module class.

@jdiazgon
Copy link
Member Author

That's fine for me. I agree that it is a good idea to have another increment for the generation of lazy loading pages.

Maybe we could say this is a "nice to have" feature that we will implement if we have enough time. Right now I will focus on the things the Italians told us to implement, if both of you agree.

@maybeec
Copy link
Member

maybeec commented Apr 13, 2018

Agree. Lets put it to the bottom of the prio-list.

@github-actions
Copy link

Stale topic. Please negotiate closing or discussing the relevance of this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants