From 86db592b5cc9c1feeeb8264799cc53784051cfa8 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 6 Feb 2020 12:52:34 -0800 Subject: [PATCH] docs(ivy): add a not about compile-time constants to the ivy compatibility guide (#35194) PR Close #35194 --- aio/content/guide/ivy-compatibility.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aio/content/guide/ivy-compatibility.md b/aio/content/guide/ivy-compatibility.md index 68595209e4374..787087f31eaf3 100644 --- a/aio/content/guide/ivy-compatibility.md +++ b/aio/content/guide/ivy-compatibility.md @@ -23,14 +23,17 @@ If the errors are gone, switch back to Ivy by removing the changes to the `tscon If you notice that the size of your application's main bundle has increased with Ivy, you may want to check the following: 1. Verify that the components and `NgModules` that you want to be lazy loaded are only imported in lazy modules. -Anything that you import outside lazy modules can end up in the main bundle. -See more details in the original issue [here](https://github.com/angular/angular-cli/issues/16146#issuecomment-557559287). +Anything that you import outside lazy modules can end up in the main bundle. +See more details in the original issue [here](https://github.com/angular/angular-cli/issues/16146#issuecomment-557559287). 1. Check that imported libraries have been marked side-effect-free. -If your app imports from shared libraries that are meant to be free from side effects, add "sideEffects": false to their `package.json`. +If your app imports from shared libraries that are meant to be free from side effects, add "sideEffects": false to their `package.json`. This will ensure that the libraries will be properly tree-shaken if they are imported but not directly referenced. See more details in the original issue [here](https://github.com/angular/angular-cli/issues/16799#issuecomment-580912090). +1. Projects not using Angular CLI will see a significant size regression unless they update their minifier settings and set compile-time constants `ngDevMode`, `ngI18nClosureMode` and `ngJitMode` to `false` (for Terser, please set these to `false` via [`global_defs` config option](https://terser.org/docs/api-reference.html#conditional-compilation)). +Please note that these constants are not meant to be used by 3rd party library or application code as they are not part of our public api surface and might change in the future. + {@a common-changes} ### Changes you may see @@ -78,4 +81,4 @@ See more details in the original issue [here](https://github.com/angular/angular * `DebugElement.classes` returns `undefined` for classes that were added and then subsequently removed (previously, classes added and later removed would have a value of `false`). -* If selecting the native `