Just read Understanding @NgModule 
<https://docs.google.com/document/d/1isijHlib4fnukj-UxX5X1eWdUar6UkiGKPDFlOuNy1U/pub>
 
and also went to the Using NgModules to Build Awesome Angular Apps 
<https://www.meetup.com/AngularJS-SF/events/232788601/> SF Meetup last 
night where Steven Fluin talked about @NgModule (great talk BTW - and 
thanks to Heston from Lyft for his talk too!)

I have a few questions.

   1. As I understand it (from Steven's talk last night), compilation will 
   generate JS from your templates (kinda like JSX I guess) and then tree 
   shakes the code to pluck out only the referenced components/modules to 
   include in the delivery to the client - all the rest is ignored (I hope I 
   got that right - please correct me if I did not.) As a result of the tree 
   shaking, are you saying, only the specific JS files you need will be sent 
   down to the client? Given that, you could, in effect, import the world in 
   your app's NgModule and let the tree shaking separate the wheat from the 
   chaff - is that accurate (not that I would recommend it, but in theory, 
   that is a valid assummption)?
   2. In a web app, when would you want to have JIT compilation (vs 
   pre-compilation). An app that is pre-compiled would result in faster perf, 
   plus you wouldn't have to ship the compiler down to the client. So, why 
   wouldn't you want to use pre-compilation? What is/are the use case(s) for 
   JIT compilation? Is Angular Universal doing something similar?
   3. If, in my app, I have very separate modules that don't share much 
   (dashboard, admin, reporting), would it make sense to have an app NgModule 
   and then one NgModule for each of these sections/modules? Is this a way to 
   approach lazy loading modules (in addition to, in conjunction with, or 
   separate from lazy loading routes?)
   

Thanks,
--Ed

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to