9cec94a008
The import graph scans source files for its import and export statements to extract the source files that it imports/exports. Such statements contain a module specifier string and this module specifier used to be resolved to the actual source file using an explicit module resolution step. This is especially expensive in incremental rebuilds, as the module resolution cache has not been primed during program creation (assuming that the incremental program was able to reuse the module resolution results from a prior compilation). This meant that all module resolution requests would have to hit the filesystem, which is relatively slow. This commit is able to replace the module resolution with TypeScript's bound symbol of the module specifier. This symbol corresponds with the `ts.SourceFile` that is being imported/exported, which is exactly what the import graph was interested in. As a result, no filesystem accesses are done anymore. PR Close #40948 |
||
---|---|---|
.. | ||
src | ||
test | ||
BUILD.bazel | ||
README.md | ||
index.ts | ||
main-ivy-ngcc.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