angular/packages/compiler/src/render3
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
..
partial refactor(compiler-cli): carry type information into AST value types (#39961) 2020-12-08 12:01:57 -08:00
view refactor(compiler): add type information to DefinitionMap (#39961) 2020-12-08 12:01:56 -08:00
r3_ast.ts refactor(compiler-cli): add keySpan to reference nodes (#39616) 2020-11-12 15:12:53 -08:00
r3_factory.ts fix(compiler): add PURE annotation to getInheritedFactory calls (#38291) 2020-07-30 16:53:52 -07:00
r3_identifiers.ts feat(compiler-cli): support for partial compilation of components (#39707) 2020-11-24 13:05:49 -08:00
r3_jit.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
r3_module_compiler.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
r3_module_factory_compiler.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
r3_pipe_compiler.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
r3_template_transform.ts refactor(compiler-cli): add keySpan to reference nodes (#39616) 2020-11-12 15:12:53 -08:00
r3_types.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
util.ts refactor(compiler-cli): use ngDevMode guard for setClassMetadata call (#39987) 2020-12-10 13:23:13 -08:00