liveBook · Manning

Just-in-time compilation

As explained in Modern Angular

Just-in-time compilation is compilation performed during application startup or execution rather than entirely before deployment.

Just-in-time compilation (JIT) compiles an Angular application's templates while the application starts or runs. With ng serve, Angular bootstraps the application and compiles templates in the browser, making development faster despite poorer runtime performance. section 9.2.3

Production deployment instead uses ng build to create a precompiled application through ahead-of-time compilation (AOT), allowing the browser to execute generated rendering commands directly. Both approaches compile templates into JavaScript commands, supporting rendering on the server and in the browser. section 9.2.3

The practical distinction is:

  • Use JIT during development when faster development build times matter most. section 9.2.3
  • Use AOT for production so templates are compiled before deployment and need not be compiled in the browser. section 9.2.3

How Modern Angular covers it

How deep it goes
Explains template-to-JavaScript compilation, development trade-offs, and AOT contrast, but omits compiler internals.
Examples
Uses ng serve for JIT development and ng build for a precompiled production application.
What it assumes
Assumes familiarity with Angular applications, templates, ng serve, and ng build while defining template compilation from its purpose.
What you can do after
Evaluate when Angular development should use JIT and when deployment should use ahead-of-time compilation.
How it connects
Connects Angular templates with ahead-of-time compilation, server-side rendering, and browser rendering.

Also explained in

Compare how 7 books explain just-in-time compilation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Modern Angular. The section links point to the parts of the book it draws on.