Skip to content

Commit

Permalink
docs(ivy): add a not about compile-time constants to the ivy compatib…
Browse files Browse the repository at this point in the history
…ility guide (angular#35194)

PR Close angular#35194
  • Loading branch information
IgorMinar authored and mhevery committed Feb 6, 2020
1 parent 053dabb commit 86db592
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions aio/content/guide/ivy-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 `<option>` element in a `<select>` where the `<option>`s are created via `*ngFor`, use the `[selected]` property of an `<option>` instead of binding to the `[value]` property of the `<select>` element (previously, you could bind to either.) [details](guide/ivy-compatibility-examples#select-value-binding)
* If selecting the native `<option>` element in a `<select>` where the `<option>`s are created via `*ngFor`, use the `[selected]` property of an `<option>` instead of binding to the `[value]` property of the `<select>` element (previously, you could bind to either.) [details](guide/ivy-compatibility-examples#select-value-binding)

0 comments on commit 86db592

Please sign in to comment.