I really liked your overview. It has got just the right level of abstraction. Well done!
Thank you Ajit for sharing the insightful article! Here is my feedback:
You’ve wrote: “Angular has two compilers: ngtsc and ngcc.” --> that was confusing for me. After investing time in search this is what I’ve understood: Angular does not have 2 compilers ngtsc & ngcc. It has 2 compiler entry-points:
ngcc. They are kind of parts of
@angular/compiler-cli and they don’t have the same functionalities.
The following is from the Angular compiler architecture documentation in Github:
tscwhich includes a set of Angular transforms. While Ivy is experimental,
enableIvyflag is set to
tsconfig.jsonfile for the project.
ngcc(which stands for Angular compatibility compiler) is designed to process code coming from NPM and produce the equivalent Ivy version, as if the code was compiled with
ngtsc. It will operate given a
node_modulesdirectory and a set of packages to compile, and will produce an equivalent directory from which the Ivy equivalents of those modules can be read.
ngccis a separate script entry point to
ngcccan also be run as part of a code loader (e.g. for Webpack) to transpile packages being read from