1f73af77a7
Prior to this change, the `setClassMetadata` call would be invoked inside of an IIFE that was marked as pure. This allows the call to be tree-shaken away in production builds, as the `setClassMetadata` call is only present to make the original class metadata available to the testing infrastructure. The pure marker is problematic, though, as the `setClassMetadata` call does in fact have the side-effect of assigning the metadata into class properties. This has worked under the assumption that only build optimization tools perform tree-shaking, however modern bundlers are also able to elide calls that have been marked pure so this assumption does no longer hold. Instead, an `ngDevMode` guard is used which still allows the call to be elided but only by tooling that is configured to consider `ngDevMode` as constant `false` value. PR Close #39987 |
||
---|---|---|
.. | ||
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