angular-cn/packages/compiler-cli/ngcc/test
JoostK 1f73af77a7 refactor(compiler-cli): use `ngDevMode` guard for `setClassMetadata` call (#39987)
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
2020-12-10 13:23:13 -08:00
..
analysis fix(compiler-cli): remove the concept of an errored trait (#39923) 2020-12-03 13:42:13 -08:00
dependencies test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
entry_point_finder test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
execution fix(ngcc): ensure lockfile is removed when analyzeFn fails (#37739) 2020-06-29 10:29:11 -07:00
helpers perf(ngcc): introduce cache for sharing data across entry-points (#38840) 2020-09-15 11:23:04 -07:00
host fix(compiler-cli): remove the concept of an errored trait (#39923) 2020-12-03 13:42:13 -08:00
integration refactor(compiler-cli): use `ngDevMode` guard for `setClassMetadata` call (#39987) 2020-12-10 13:23:13 -08:00
locking Revert "perf(ngcc): allow immediately reporting a stale lock file (#37250)" (#39435) 2020-10-27 13:36:27 -07:00
migrations test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
packages test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
rendering refactor(compiler-cli): use `ngDevMode` guard for `setClassMetadata` call (#39987) 2020-12-10 13:23:13 -08:00
writing test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
BUILD.bazel test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
ngcc_options_spec.ts perf(ngcc): reduce maximum worker count (#38840) 2020-09-15 11:23:09 -07:00
utils_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00