Code difference between libraries build in View Engine and IVY

756 views Asked by At

I am unable to figure out the code difference between libraires compatible with View Engine and IVY. I have recently migrated my code to Agular 16 and getting error for some modules that they are not a part of NgModule class. I think route cause is the depreciation of ngcc compiler. So, can anyone tell me the difference in code for libraries belonging to each runtime?

I want to make my custom libraries compatible for IVY

1

There are 1 answers

0
Matthieu Riegler On

View Engine is the legacy rendering engine of Angular, it was replaced by the Ivy rendering engine in v9.

When you build Angular libs, the Angular compiler will compile the components in a way that it will not use the template instructions (compare components in a lib vs a components in a final bundle). Those intermidiate compilated components are not compatible (Ivy vs ViewEngine), so the Angular team built the NGCC (Angular Compatibility Compiler) to ensure a smooth transition from VE to Ivy.

In the v16, the Angular team removed the NGCC that allowed ViewEngine libs to run with the Ivy rendering engine, thus ending the transition period from ViewEngine to Ivy