Ivy – strict templates
Better errors
@CONSTJS
ERROR in src/app/app.component.html:4:19 - error TS2322:
Type 'null' is not assignable to type 'string'.
4
~~~~~~~~~~~~~~~~~~~~~~~~
After Ivy:
Build error
TestBed – Speed test
@CONSTJS
• We use jest .
• 7.5k tests: no difference
• On Karma gain is expected up to 50%
Slide 24
Slide 24 text
I18N
@CONSTJS
Slide 25
Slide 25 text
i18n – Before Ivy
@CONSTJS
Translations in HTML
3 languages = 3 builds = 3 bundles
No runtime translations
Slide 26
Slide 26 text
i18n – AAer Ivy
@CONSTJS
TranslaPons in HTML and TypeScript
3 languages = 1 build = 3 bundles
No runPme translaPons yet
Slide 27
Slide 27 text
i18n – TranslaBon in TypeScript
@CONSTJS
class AppComponent {
name = 'Angular Tricity’;
title = `Hello, ${name}!`;
}
Slide 28
Slide 28 text
i18n – Translation in TypeScript
@CONSTJS
class AppComponent {
name = 'Angular Tricity’;
title = $localize`Hello, ${name}!`;
}
Slide 29
Slide 29 text
MIGRATION
TIPS
@CONSTJS
Slide 30
Slide 30 text
@CONSTJS
Slide 31
Slide 31 text
@CONSTJS
➜ ng update @angular/core @angular/cli –-create-commits
• takes 11 minutes
• with nice progress bar
Slide 32
Slide 32 text
Big-bang migraBon
with angular cli
+ lots of manual adjustments
@CONSTJS
➜ ng update @angular/core @angular/cli –-create-commits
+ then runMme errors
420 modified files
Slide 33
Slide 33 text
Goal: Step by step migration
❌ TypeScript 3.7
❌ Ivy run2me
❌ Migra2on to TestBed.inject()
❌ Migra2on of loadChildren
❌ New i18n package
Without...
@CONSTJS
We updated with 6 files:
Slide 34
Slide 34 text
Goal: Step by step migraBon
✅ Cherry-pick code-migra2ons to Angular 8.2
✅ Fix TypeScript issues found in 3.6 / 3.7
Before update...
@CONSTJS
Slide 35
Slide 35 text
Goal: Step by step migraBon
✅ Bump Angular to 9.0.x
✅ Disable Ivy
✅ (op2onal) Downgrade TypeScript to 3.6
update...
@CONSTJS
Slide 36
Slide 36 text
Goal: Step by step migraBon
✅ Migrate to TypeScript 3.7
✅ Follow Ivy migra2on
✅ Enable strictTemplates and strictNullChecks in tsconfig
After update...
@CONSTJS
Slide 37
Slide 37 text
WHAT’S NEXT
@CONSTJS
Slide 38
Slide 38 text
ANGULAR 10+
Ivy renderer for libraries
Final touch for i18n
ESlint migraMon
@CONSTJS
‼
speculated
Opening Ivy internal APIs
*ngIf="stream$ | async"
replacement
Slide 39
Slide 39 text
@CONSTJS
Slide 40
Slide 40 text
YES!
I’m super excited!
@CONSTJS
Slide 41
Slide 41 text
Ques%ons?
Let’s talk
PIOTR
LEWANDOWSKI
Twi1er:
@constjs