What the Compilation !?

$ whoami

Compilation

class Person {
    public string name;
    public string address;

    constructor(name, address) {
        this.name = name;
        this.address = address;
    }
}

Compilation is a process which converts human friendly code to machine friendly code

Compilation in Angular

 Graphics taken from the Essential Angular blogpost by Victor Savkin

Just in Time Compilation

All the magic happens JIT (Just in Time) on the browser

This is what Angular 1.x compiler did

Ahead of Time Compilation

App is pre-built/offline-compiled when it lands on the browser

Why AOT?

  • Faster rendering - precompiled
  • Smaller bundle - compiler not shipped
  • Fewer async requests - templates, styles

When JIT?

How to ?

Faster ...

  • Tree shaking
  • Lazy loading
  • Code splitting

$ signoff

2 days of Angular 2 Awesomeness

Walk in as a noob, walk out as an Angular Pro

What the compilation ?

By Mohammad Umair Khan

What the compilation ?

Breaking down compilation in Angular 2 for Ng Pakistan meetup

  • 1,590