Skip to content

Instantly share code, notes, and snippets.

@LayZeeDK
Last active July 23, 2021 07:27
Show Gist options
  • Save LayZeeDK/61caba93df1ec1a0788c94a973c8dfac to your computer and use it in GitHub Desktop.
Save LayZeeDK/61caba93df1ec1a0788c94a973c8dfac to your computer and use it in GitHub Desktop.
The Angular View Engine-to-Ivy transition plan.
Angular version Application engine Library engine Status
Version 9 View Engine View Engine Supported, but not recommended
Version 9 View Engine Ivy Not supported
Version 9 Ivy View Engine Recommended
Version 9 Ivy Ivy Supported, but not recommended
Version 10 View Engine View Engine Supported, but not recommended
Version 10 View Engine Ivy Not supported
Version 10 Ivy View Engine Supported, but not recommended
Version 10 Ivy Ivy Recommended
Version 11 View Engine View Engine Not supported
Version 11 View Engine Ivy Not supported
Version 11 Ivy View Engine Supported, but not recommended
Version 11 Ivy Ivy Recommended
@ChaitanyaBabar
Copy link

ChaitanyaBabar commented Apr 29, 2020

@LayZeeDK

Shouldn't be status for row number 5 i.e. Version 9 , Ivy , Ivy be Supported, but not recommended instead of Supported ?

@LayZeeDK
Copy link
Author

Thanks @ChaitanyaBabar!

I noticed recently, that the Angular CLI will even prevent us from compiling a package library with Ivy.

@ChaitanyaBabar
Copy link

ChaitanyaBabar commented Apr 30, 2020 via email

@LayZeeDK
Copy link
Author

@ChaitanyaBabar There's probably some way of going around it, but yes the ng-packagr builder basically refuses to build a library with "enableIvy": true.

@LayZeeDK
Copy link
Author

In Angular CLI version 10, a warning is shown which recommends against targeting the Ivy Instruction Set when building an Angular library.

@sambernet
Copy link

sambernet commented Feb 2, 2021

In Angular CLI version 10, a warning is shown which recommends against targeting the Ivy Instruction Set when building an Angular library.

That's still the case in Angular 11 (11.0.2 exactly).
Also the ng-packagr configuration still adds an extra prePublish npm script to the library that will fail the npm publish operation in case the library has been compiled with Ivy.

@LayZeeDK
Copy link
Author

LayZeeDK commented Feb 2, 2021

That's right, @sambernet. Unfortunately, the Angular team's migration plan had to change, so this Gist is not accurate.

The new strategy is based on the Angular Linker which means partial Ivy compilation (no template compilation) of libraries published on NPM and supported by Angular application builders. There's no timeline for this yet, but the first preview of the Angular linker was released in Angular 11.1.

@sambernet
Copy link

That's alright and the very nature of plans - thus wasn't meant as criticism 😉

Your gist popped up on my journey to figuring out how to publish libraries compiled with ivy, so I wanted to leave a note about the current state. For reference, the most insightful link for that topic ended up being this one from petebacondarwin

Disclaimer: We publish ng libraries for internal reuse in an internal npm registry, don't have view engine in use anymore and are well-aware of the fact that angular upgrades will require recompilation of the shared libraries

Didn't expect a reply whatsoever, so thanks for the heads-up on the things to come 👍

@LayZeeDK
Copy link
Author

LayZeeDK commented Feb 2, 2021

If anyone's interested in the Angular Linker, read this RFC and the resources it references: angular/angular#38366.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment