Skip to content

Architecture and Tricks for Migrations & Schematics

Nikolay Alipiev edited this page Feb 8, 2024 · 10 revisions

Modules in schematics

With IVY introduced by angular, all angular packages became ESModules, except angular schematics, which is a CommonJS one. In our Ignite UI angular schematics we need to call some of the other angular modules like @angular/compiler and dynamic import() is needed. But this is compiled to require() instead of preserved as a dynamic module, because of the CommonJS nature of the schematics. Our solution, in that case, is to introduce a util function in a .js file instead of .ts, which contains the native dynamic import(), therefore being a .js after a compilation the import is preserved: https://github.com/IgniteUI/igniteui-angular/pull/10043/files#diff-be445e23dd0ce197a4f388f80338f15ed89c9d55e3492950a12447dd6fbcd68d

Turn on encapsulation for devkit/schematics dependencies

https://github.com/IgniteUI/igniteui-angular/pull/13712

Clone this wiki locally