Present and Future of Angular with Ivy Template ViewEngine Ivy - - PowerPoint PPT Presentation

present and future of angular with ivy
SMART_READER_LITE
LIVE PREVIEW

Present and Future of Angular with Ivy Template ViewEngine Ivy - - PowerPoint PPT Presentation

Present and Future of Angular with Ivy Template ViewEngine Ivy Compiler Gen Gen Gen @SiddAjmera 3 Ivy is an enabler @SiddAjmera Design Goals OPTIMIZABILITY INCREMENTALITY FLEXIBILITY Only pay for


slide-1
SLIDE 1

Present and Future of Angular with Ivy

slide-2
SLIDE 2

Template Compiler ViewEngine Ivy

@SiddAjmera

Gen ☝ Gen ✌ Gen 󾠱

slide-3
SLIDE 3

Ivy is an enabler

3

@SiddAjmera

slide-4
SLIDE 4

FLEXIBILITY ◉ Simple & easier to pick, understand, & debug ◉ HoC ◉ Module-less Apps ◉ Dynamic Component Loading

Design Goals

OPTIMIZABILITY ◉ Only pay for what you use ◉ Tree Shaking ◉ No metadata files ◉ Smaller bundles INCREMENTALITY ◉ Locality ◉ Faster compilation, builds, & test execution

@SiddAjmera

4
slide-5
SLIDE 5

fn createViewNodes(view: ViewDef) { view.nodes.forEach(node => { switch(node.type) { case ELEMENT: createElement(...) case TEXT: createText(...) case DIRECTIVE: createDirectiveInstance(...) ... } }); }

Courtesy: @vikerman

Rendering Engine

export function ɵɵelementStart(..) {..} export function ɵɵtemplate(..) {..} export function ɵɵtext(..) {..} ...

@SiddAjmera

slide-6
SLIDE 6

export function ɵɵelementStart(..) {..}

Credits: @vikerman

Template Rendering Engine

export function ɵɵtemplate(..) {..} export function ɵɵtext(..) {..} ...

Tree Shaken

Unused Ivy Instructions

@SiddAjmera

slide-7
SLIDE 7

Ivy Instruction Set

◉ DOM Creation ◉ Data Binding ◉ Change Detection ◉ I18N ◉ Queries ◉ Dependency Injection

7

◉ Styling ◉ Containers ◉ Templates ◉ Content Projection ◉ Pipes ◉ SVG

@SiddAjmera

slide-8
SLIDE 8 8

@SiddAjmera

slide-9
SLIDE 9 9

@SiddAjmera

slide-10
SLIDE 10

component.ts component.html component.js component.ngfactory.js

Courtesy: @vikerman

component.js component.ngsummary.json component.metadata.json component.scss

@SiddAjmera

slide-11
SLIDE 11

🌴🤞 + 🚬🤙 = ฀📧

@SiddAjmera

slide-12
SLIDE 12 12

@SiddAjmera

slide-13
SLIDE 13

@SiddAjmera

slide-14
SLIDE 14 14

@SiddAjmera

slide-15
SLIDE 15

@NgModule ɵmod ɵɵdefineModule @Directive ɵdir ɵɵdefineDirective @Injectable ɵprov ɵɵdefineInjectable @Pipe ɵpipe ɵɵdefinePipe @Component ɵcmp ɵɵdefineComponent

@SiddAjmera

slide-16
SLIDE 16 16 Ivy FTW - NG SriLanka Conf.

@SiddAjmera

slide-17
SLIDE 17

FLEXIBILITY ◉ Module-less Apps ◉ Simple & easier to pick, understand, & debug ◉ Dynamic Component Loading ◉ HoC

Design Goals

OPTIMIZABILITY ◉ Only pay for what you use ◉ No metadata files ◉ Tree Shaking ◉ Smaller bundles INCREMENTALITY ◉ Locality ◉ Faster compilation, builds, & test execution

@SiddAjmera

17
slide-18
SLIDE 18

I am Siddharth Ajmera

FullStack JS Developer Angular Writer Instructor

Hello World! 👌

@SiddAjmera

slide-19
SLIDE 19

PRESENT

A few examples to demonstrate how awesome Ivy is

19

@SiddAjmera

🆖

slide-20
SLIDE 20

Small & Meaningful Stacktraces

To get you straight to the source of your error.

1

20 View Engine V/S Ivy

@SiddAjmera

slide-21
SLIDE 21

AoT by default

So that you can see the error right while developing

2

21 AoT by default with Ivy 🍄

@SiddAjmera

slide-22
SLIDE 22

Lazy Loading Components

So that you can load components lazily and only when required.

3

22

@SiddAjmera

slide-23
SLIDE 23

ng Object for 🚬🐜

So that you can debug your code more easily at runtime

4

23

@SiddAjmera

Debugging Angular Ivy Applications from the Devtools Console
slide-24
SLIDE 24

FUTURE

A few examples to demonstrate how Ivy enables the awesome future

24

@SiddAjmera

🔯

slide-25
SLIDE 25

Angular Modules are linchpins in an Angular Application

25

@SiddAjmera

slide-26
SLIDE 26

Render Components without Angular Modules from Scratch

To write Angular Component from Scratch without much dependency

  • n Angular Modules, ZoneJS etc.

1

26 Angular Component with Change Detection from scratch in Ivy

@SiddAjmera

slide-27
SLIDE 27

Render Components without Angular Modules via Compiler

As you might not want to write the whole boilerplate again and again.

2

27 Angular Component via Compiler with Change Detection in Ivy

@SiddAjmera

slide-28
SLIDE 28

Dynamically Loading a Lazy Component with Ivy’s ɵrenderComponent

To give you the flexibility to load a Component lazily and dynamically

3

28

@SiddAjmera

slide-29
SLIDE 29

DI in a Dynamically Loaded Lazy Component

Coz what’s an Angular App without DI?

4

29

@SiddAjmera

slide-30
SLIDE 30 30 Angular Ivy - Dutch Angular Group

@SiddAjmera

slide-31
SLIDE 31

WHERE FROM HERE?

Into a world of Angular Apps where things like Angular Modules, ZoneJS, and RxJS is

  • ptional
31

🤕

Code Repo to Demo proposal for Standalone Angular Components

@SiddAjmera

slide-32
SLIDE 32

Any questions ?

You can find me at ◉ @SiddAjmera ◉ SiddAjmera.DEV

32

Thanks! 🙐

@SiddAjmera

slide-33
SLIDE 33

Credits

Special thanks to all the people who made and released these awesome resources for free: ◉ Presentation template by SlidesCarnival ◉ Photographs by Unsplash

33