Can we use the Angular Ahead-Of-Time compiler for KUIB-projects? - Forum - Kendo UI Builder - Progress Community

Can we use the Angular Ahead-Of-Time compiler for KUIB-projects?

 Forum

Can we use the Angular Ahead-Of-Time compiler for KUIB-projects?

This question is answered

For performance reasons (loading of the KUIB-app takes too long) we want to use the Angular Ahead-Of-Time compiler.

Can we use this for building Angular projects created with KUIB? There seem to be issues with it, specifics I still need to get from .
I was sort of surprised to hear this doesn't work, since Kendo UI for Angular components should support this out-of-the-box

Verified Answer
  • Hello Ruben,

    I just tried it out and it seems to work fine for me.

    Are you using AOT for development or for production builds?

    I used Kendo UI Builder 3.0.6 with a project using @progress/jsdo-angular 5.0.0.

    Here are the steps that I used (from app folder):

    1) Add "@progress/jsdo-core": "^5.0.0" explicitly as a dependency to package.json.

    2) npm update @progress/jsdo-core. This updates @progress/jsdo-core to version 5.0.1 which includes a fix that you need for the production build.

    3) Build for production with AOT using the following command:

       ng build --prod --aot --output-path=./../build-output/release/

    This is the same command as listed for the "build:prod" script in package.json with the addition of --aot.

    Please let me know if you have details on issues when using AOT.

    I hope this helps.

All Replies
  • Hello Ruben,

    I just tried it out and it seems to work fine for me.

    Are you using AOT for development or for production builds?

    I used Kendo UI Builder 3.0.6 with a project using @progress/jsdo-angular 5.0.0.

    Here are the steps that I used (from app folder):

    1) Add "@progress/jsdo-core": "^5.0.0" explicitly as a dependency to package.json.

    2) npm update @progress/jsdo-core. This updates @progress/jsdo-core to version 5.0.1 which includes a fix that you need for the production build.

    3) Build for production with AOT using the following command:

       ng build --prod --aot --output-path=./../build-output/release/

    This is the same command as listed for the "build:prod" script in package.json with the addition of --aot.

    Please let me know if you have details on issues when using AOT.

    I hope this helps.

  • Hello,

    We have followed the instructions in egarcia post.

    We are using KUIB 3.0.6.

    We update jsdo-core from 5.0.0 to 5.0.1 as instructed .

    We change build command that we are using from

    ng build --prod --aot=false --output-path=./../build-output/release/ --base-href #ipui

    to

    ng build --prod --aot --output-path=./../build-output/release/ --base-href #ipui

    The build fails with errors regarding our custom components :

    "Cannot determine the module for class FilterSection in c:/workspace/app/src/app/shared/components/filter-section/filter-section.component.ts! Add FilterSection to the NgModule to fix it"

    The components are added to the project in the folowing way :

    Component definition :

    @Component({

       selector: 'filter-section',

       templateUrl: './filter-section.component.html',

    })

    export class FilterSection {

    Component added to config before @NgModule in shared.module.ts:

    import { config } from './shared.config';

    import { FilterSection } from './components/filter-section/filter-section.component';

    config.declarations.push(FilterSection);

    config.exports.push(FilterSection);

    @NgModule(config)

    The errors appear only when the aot option is true.

    The error is thrown for all custom components.

    Are the components themself at fault here ?

    Can some one cofirm that they are using custom components and the aot = true option?

  • Hello,

    I was able to reproduce the issue that you are seeing when the aot option is true.

    This seems to happen either when specifying --aout or when omitting it altogether:

    - ng build --prod --output-path=./../build-output/release/ --base-href #ipui

    I found some few references to the error that you mentioned in Angular issues in GitHub:

    - github.com/.../19544

    - github.com/.../8062

    These issues in the links happen when the case of the modules do not match or there are duplicate files.

    There may be other conditions that causes the error based on some peculiarity of the custom components.

    Perhaps, the issue is not specific to Kendo UI Builder but something in the code in the custom components.

    A possible way to troubleshoot would be to reduce the code to the very minimal. If the issue does not occur then add code back.

    I wonder if people in the Angular GitHub also have info on the error.

    I hope this helps.

  • Hello,

    I was able to reproduce the issue that you are seeing when the aot option is true.

    This seems to happen either when specifying --aout or when omitting it altogether:

    - ng build --prod --output-path=./../build-output/release/ --base-href #ipui

    I found some few references to the error that you mentioned in Angular issues in GitHub:

    - github.com/.../19544

    - github.com/.../8062

    These issues in the links happen when the case of the modules do not match or there are duplicate files.

    There may be other conditions that causes the error based on some peculiarity of the custom components.

    Perhaps, the issue is not specific to Kendo UI Builder but something in the code in the custom components.

    A possible way to troubleshoot would be to reduce the code to the very minimal. If the issue does not occur then add code back.

    I wonder if people in the Angular GitHub also have info on the error.

    I hope this helps.