964d72610f
ngcc needs to solve a unique problem when compiling typings for an entrypoint: it must resolve a declaration within a .js file to its representation in a .d.ts file. Since such .d.ts files can be used in deep imports without ever being referenced from the "root" .d.ts, it's not enough to simply match exported types to the root .d.ts. ngcc must build an index of all .d.ts files. Previously, this operation had a bug: it scanned all .d.ts files in the .d.ts program, not only those within the package. Thus, if a class in the program happened to share a name with a class exported from a dependency's .d.ts, ngcc might accidentally modify the wrong .d.ts file, causing a variety of issues downstream. To fix this issue, ngcc's .d.ts scanner now limits the .d.ts files it indexes to only those declared in the current package. PR Close #32129 |
||
---|---|---|
.. | ||
src | ||
test | ||
BUILD.bazel | ||
README.md | ||
index.ts | ||
main-ngcc.ts |
README.md
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