Slide 1

Slide 1 text

Ivy Engine@ Angular Berlin A deep dive into the heart of Angular Martina Kraus

Slide 2

Slide 2 text

@MartinaKraus11 • Senior Frontend Dev @inovex GmbH • Trainer @Angular.DE • ngGirls • Angular Heidelberg Martina Kraus

Slide 3

Slide 3 text

Agenda ● Why do we need a new Engine? ● How does it work? ● How to use? 3 @MartinaKraus11

Slide 4

Slide 4 text

Why ? 4

Slide 5

Slide 5 text

A short history @MartinaKraus11 Ivy View Engine Template Engine Angular 2 Angular 4 Angular 8

Slide 6

Slide 6 text

Costliest Ressource on a webpage? 6 HTML ? CSS ? JavaScript ! Not only bundle size as well parsing and execution

Slide 7

Slide 7 text

7 AngularMix Keynote 2018 Public - Brad Green

Slide 8

Slide 8 text

Benefits 8 @MartinaKraus11 Faster compilation Smaller Easier to debug

Slide 9

Slide 9 text

And how ?

Slide 10

Slide 10 text

10 @MartinaKraus11 Faster compilation Smaller Easier to debug

Slide 11

Slide 11 text

ViewEngine 11 @MartinaKraus11 cat.component.ts cat.component.scss cat.component.html cat.component.js cat.component.ngfactory.js

Slide 12

Slide 12 text

Ivy 12 @MartinaKraus11 cat.component.ts cat.component.scss cat.component.html cat.component.js

Slide 13

Slide 13 text

13 @MartinaKraus11 Vikram Subramanian - ngIndia 2019

Slide 14

Slide 14 text

How to make things smaller ● Don’t pay for framework features you don’t use 14 @MartinaKraus11 ● View Engine isn’t tree-shakable tree-shaking

Slide 15

Slide 15 text

15 @MartinaKraus11 ViewEngine Kara Erickson - ngConf 2018

Slide 16

Slide 16 text

16 @MartinaKraus11 ViewEngine Array of Instructions Kara Erickson - ngConf 2018

Slide 17

Slide 17 text

17 @MartinaKraus11 Template Function calls elementStart() text() export function elementStart() Ivy Component definition calls Framework export function text()

Slide 18

Slide 18 text

18 @MartinaKraus11 Faster compilation Easier to debug Smaller

Slide 19

Slide 19 text

Faster compilation ● Compiling them only requires local information ● If Component changes, it’s dependencies doesn’t have to recompile 19 @MartinaKraus11 Locality principle

Slide 20

Slide 20 text

View Engine 20 @MartinaKraus11 Vikram Subramanian - ngIndia 2019

Slide 21

Slide 21 text

Ivy 21 @MartinaKraus11 Vikram Subramanian - ngIndia 2019

Slide 22

Slide 22 text

Ivy 22 @MartinaKraus11 Vikram Subramanian - ngIndia 2019

Slide 23

Slide 23 text

Faster compilation ● Ivy provides “stable” API to ship compiled through NPM No global compilation needed anymore Modules are already AOT 23 @MartinaKraus11

Slide 24

Slide 24 text

24 @MartinaKraus11 Faster compilation Easier to debug Smaller

Slide 25

Slide 25 text

Easier to Debug ● With cleaner API: improvements an Stack traces ● Setting breakpoints in Templates ○ Stepping into the instructions for the creation of the template 25 @MartinaKraus11

Slide 26

Slide 26 text

26 I want to use it!

Slide 27

Slide 27 text

Angular Ivy in Version 8 ● Opt-in ● Backwards compatible 27 @MartinaKraus11 ng new ivy-app --enable-ivy ng build --prod

Slide 28

Slide 28 text

Inside compiler settings (tsconfig.json) 28 @MartinaKraus11 "angularCompilerOptions": { "enableIvy": true } // To get Ivy during debugging: ng serve --aot

Slide 29

Slide 29 text

Summary ● Angular’s new renderer reduces bundle size significantly ● And compiles really fast ○ Only re-compiles what changed 29 @MartinaKraus11

Slide 30

Slide 30 text

Want more? Come and join me and more awesome speakers at 30 @MartinaKraus11 Angular Conference Berlin • 30 - 31 August, 2019 @BOLLE FESTSÄLE here in Berlin

Slide 31

Slide 31 text

31 Thank you!!!