I can only answer your JIT question.

JIT is suggested (maybe even necessary) when developing using a server that
implements a live-reload mechanism as it significantly shortens the time
developers need to wait for the application to show the changes they have
made.

JIT should never be used in production as the performance cost is too much.

That being said, in my current projects, we are not using live-reload and
are using WebPack. Once the initial compile is done, it is able to
recompile just the changed modules in a very short time (seconds). Because
of these two factors, we never use JIT. The down-side is the developer must
watch the compile and, when complete, refresh the browser. The up-side is
that we are testing EXACTLY the same logic we ship in production.

-Luke

On Thu, Aug 4, 2016 at 1:25 PM, Ed Sinek <[email protected]> wrote:

> 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.
>



-- 
Lucas Lacroix
Computer Scientist
System Technology Division, MEDITECH <http://ehr.meditech.com>
781-774-2293

-- 
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