{ "id": "guide/ivy-compatibility", "title": "Ivy compatibility guide", "contents": "\n\n\n
\n mode_edit\n
\n\n\n
\n

Ivy compatibility guidelink

\n

The Angular team has worked hard to ensure Ivy is as backwards-compatible with the previous rendering engine (\"View Engine\") as possible.\nHowever, in rare cases, minor changes were necessary to ensure that the Angular's behavior was predictable and consistent, correcting issues in the View Engine implementation.\nIn order to smooth the transition, we have provided automated migrations wherever possible so your application and library code is migrated automatically by the CLI.\nThat said, some applications will likely need to apply some manual updates.

\n\n

How to debug errors with Ivylink

\n

If you're seeing errors, first temporarily turn off Ivy in your tsconfig.json and re-start your app.

\n

If you're still seeing the errors, they are not specific to Ivy. In this case, you may want to consult the general update guide. If you've opted into any of the new, stricter type-checking settings, you may also want to check out the template type-checking guide.

\n

If the errors are gone, switch back to Ivy by removing the changes to the tsconfig.json and review the list of expected changes below.

\n\n

Payload size debugginglink

\n

If you notice that the size of your application's main bundle has increased with Ivy, you may want to check the following:

\n
    \n
  1. \n

    Verify that the components and NgModules that you want to be lazy loaded are only imported in lazy modules.\nAnything that you import outside lazy modules can end up in the main bundle.\nSee more details in the original issue here.

    \n
  2. \n
  3. \n

    Check that imported libraries have been marked side-effect-free.\nIf your app imports from shared libraries that are meant to be free from side effects, add \"sideEffects\": false to their package.json.\nThis will ensure that the libraries will be properly tree-shaken if they are imported but not directly referenced.\nSee more details in the original issue here.

    \n
  4. \n
  5. \n

    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).\nPlease 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.

    \n
  6. \n
\n\n

Changes you may seelink

\n\n\n

Less common changeslink

\n\n\n \n
\n\n\n" }