johndpjr / AgTern

19 stars 5 forks source link

Modularize Angular components #152

Closed johndpjr closed 10 months ago

johndpjr commented 11 months ago

Context

Our Angular application is using Components everywhere - this is good and bad. Using Components without Modules causes the Angular application to load all Components at once- which is incredibly inefficient and slow. If we moved everything into Modules, we could load them lazily (i.e. load them when needed). For example, if we open the Jobs page (and all the jobs components were in the Job module), then all the corresponding components for the Job module are loaded on request. Right now when we go to the home page, it loads the toolbar, jobs page, login page, sign up page, etc.

TODO

Notes

JeremyEastham commented 10 months ago

Another way to achieve this is by using Angular's new Standalone Components. If done in this way, each component would become its own mini-module with its own dependencies that can be lazily loaded independently.