This is a migrated thread and some comments may be shown as answers.

Bundle size

3 Answers 1202 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andrii
Top achievements
Rank 1
Andrii asked on 05 Mar 2020, 05:16 PM
Hello, we want to use Charts and Sheduler components in our project. We have already tried to implement them, and so far so good, but the bundle size comes out quite large. Is there any way to reduce bundle size? For example, we do not need automatically installed @progress/kendo-angular-buttons, @progress/kendo-angular-dateinputs, @progress/kendo-angular-dialog and few other components in our project. Could we remove and install them if necessary?

3 Answers, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 06 Mar 2020, 09:31 AM

Hi Andrii,

Judging by the provided picture, this seems to be an unoptimized bundle. Please try running ng build --prod and see if there is any difference.

Regarding the automatically installed packages - they are required by the Charts and/or the Scheduler. For example in this demo the buttons in the Scheduler are kendoButton directives which are part of the @progress/kendo-angular-buttons. Removing @progress/kendo-angular-buttons would cause the app to throw an error since the Scheduler depends on this package.

I hope this helps.

Please let me know if further assistance on the topic is needed.

Regards,
Petar
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Andrii
Top achievements
Rank 1
answered on 06 Mar 2020, 04:13 PM
Thank you for your reply. It was an optimized bundle built with ng build --prod. ChartsModule and SchedulerModule added ~1MB of js to optimized bundle not to mention ~400KB of styles. If we cannot remove those dependencies can we reduce bundle size in another way, maybe we are doing something wrong or these sizes considered normal for Kendo UI? Regarding kendoButtons, dateinputs, dialog and so on, we do not use them, because our design is slightly different from default Scheduler view and we were forced to create custom toolbar for scheduler. So we used angular material components that already present in our project. All we need is plain scheduler view component with convenient api for CRUD operations.
0
Petar
Telerik team
answered on 10 Mar 2020, 12:46 PM

Hello Andrii,

Indeed, there is no other way to reduce the size of the components. All Kendo UI for Angular components are native Angular components, and all Angular optimization techniques for reducing the bundle size are applied when building the application for production. Due to the sheer amount of use cases of each of our components it is virtually impossible for us to offer a robust and reliable way of excluding submodules on demand.

I am not familiar with the required design of the project, but since material design is mentioned I can suggest an approach which will make use of some of the automatically imported components. Kendo UI provides different themes that can be used to style an application and one of them is the Material theme. By applying the material theme(and thus using the components from Kendo UI) the desired material design could be achieved.

I hope this helps. Please let me know if I can provide any additional details or further assistance on the topic. Thank you.

    Regards,
    Petar
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
    Tags
    General Discussions
    Asked by
    Andrii
    Top achievements
    Rank 1
    Answers by
    Petar
    Telerik team
    Andrii
    Top achievements
    Rank 1
    Share this question
    or