Please sign in to comment.
fix(ngcc): ensure that adjacent statements go after helper calls (#33689
) Previously the renderers were fixed so that they inserted extra "adjacent" statements after the last static property of classes. In order to help the build-optimizer (in Angular CLI) to be able to tree-shake classes effectively, these statements should also appear after any helper calls, such as `__decorate()`. This commit moves the computation of this positioning into the `NgccReflectionHost` via the `getEndOfClass()` method, which returns the last statement that is related to the class. FW-1668 PR Close #33689
- Loading branch information
Showing with 172 additions and 52 deletions.
- +43 −0 packages/compiler-cli/ngcc/src/host/esm2015_host.ts
- +16 −0 packages/compiler-cli/ngcc/src/host/esm5_host.ts
- +12 −0 packages/compiler-cli/ngcc/src/host/ngcc_host.ts
- +0 −21 packages/compiler-cli/ngcc/src/rendering/esm5_rendering_formatter.ts
- +2 −31 packages/compiler-cli/ngcc/src/rendering/esm_rendering_formatter.ts
- +14 −0 packages/compiler-cli/ngcc/test/host/esm2015_host_import_helper_spec.ts
- +57 −0 packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts
- +13 −0 packages/compiler-cli/ngcc/test/host/esm5_host_import_helper_spec.ts
- +15 −0 packages/compiler-cli/ngcc/test/host/esm5_host_spec.ts