×
@MartinaKraus11
New Renderer since version 9
Focusing on small bundle size
Together with Bazel up 30% faster compilation time
Angular Apps should be easier to debug
@MartinaKraus11
ng update @angular/core @angular/cli
https://update.angular.io/
@MartinaKraus11
Angular provides two compilers:
@MartinaKraus11
Ngtsc (Ivy compiler): compiles Ivy-compatible code
@MartinaKraus11
@MartinaKraus11
GDE in Angular
Women Techmakers Ambassador
Trainer and Consultant
@MartinaKraus11
@MartinaKraus11
@MartinaKraus11
@MartinaKraus11
Better build times, thanks to incremental compilation
Smaller and faster bundles
Sets the ground for Angular Elements
Is easy to debug
Introduces new non-zone.js based change detection
Uses higher-order components
@MartinaKraus11
Stephen Fluin - https://blog.angular.io/version-9-of-angular-now-available-project-ivy-has-arrived-23c97b63cfa3
@MartinaKraus11
@MartinaKraus11
HTML Template
Data
Template
Angular Interpreter
DOM
@MartinaKraus11
Data template
Angular Interpreter
@MartinaKraus11
HTML Template
Template instructions
DOM
@MartinaKraus11
@MartinaKraus11
@MartinaKraus11
@MartinaKraus11
The Code that will be compiled with Ivy uses the ngtsc compiler
Libraries, npm modules, other dependencies are already precompiled
incompatible to the way ngtsc compiles Angular code
Angular team provides the compatibility compiler
@MartinaKraus11
@MartinaKraus11
ngcc scans node_modules and produces Ivy-compatible versions of each package
detects the Angular Package Format (APF) and searches for .metadata.json file and the package's entrypoint
creates output directory ngcc_node_modules (default)
@MartinaKraus11
@MartinaKraus11
copied
copied
converted
@MartinaKraus11
@MartinaKraus11
producing a partial class using JS AST
extract the static property definition from the partial class
@MartinaKraus11
@MartinaKraus11
Using Libraries
Lib author
@MartinaKraus11
@MartinaKraus11
#1: Error: Failed to compile entry-point <packagename> due to compilation errors: node_modules/<packagename>/bundles/filename.umd.js(1034,34)]
The issue:
ngcc wasn't able to find a proper entrypoint for converting instructions nor able to create wrapper files
@MartinaKraus11
@MartinaKraus11
@MartinaKraus11
@MartinaKraus11
@MartinaKraus11
Libraries can be compiled ahead-of-time and be published as such to NPM, GitHub Packages etc.
@MartinaKraus11
@MartinaKraus11
@MartinaKraus11
https://angular.io/guide/ivy-compatibility
@MartinaKraus11
@MartinaKraus11
Do I need to add EVERYTHING manually?
@MartinaKraus11
@MartinaKraus11
ng-packagr transpiles your libraries to Angular Package Format
>>npm install -D ng-packagr
@MartinaKraus11
@MartinaKraus11
Features:
https://github.com/ng-packagr/ng-packagr/blob/master/README.md
@MartinaKraus11
me@martina-kraus.io
@MartinaKraus11
martina-kraus.io
Ping me:
Slides: slides.com/martinakraus/angular-libs