In TypeScript 4.2 the `__spread` and `__spreadArrays` helpers were both replaced by the new helper function `__spreadArray` in microsoft/TypeScript#41523. These helpers may be used in downleveled JavaScript bundles that ngcc has to process, so ngcc has the ability to statically detect these helpers and provide evaluation logic for them. Because Angular is adopting support for TypeScript 4.2 it becomes possible for libraries to be compiled by TypeScript 4.2 and thus ngcc has to add support for the `__spreadArray` helper. The deprecated `__spread` and `__spreadArrays` helpers are not affected by this change. Closes #40394 PR Close #41201
Angular Compatibility Compiler (ngcc)
This compiler will convert node_modules
compiled with ngc
, into node_modules
which
appear to have been compiled with ngtsc
.
This conversion will allow such "legacy" packages to be used by the Ivy rendering engine.
Building
The project is built using Bazel:
yarn bazel build //packages/compiler-cli/ngcc
Unit Testing
The unit tests are built and run using Bazel:
yarn bazel test //packages/compiler-cli/ngcc/test
Integration Testing
There are tests that check the behavior of the overall executable:
yarn bazel test //packages/compiler-cli/ngcc/test:integration