Package Size is too high

Hello Team,


I have used Grid and Injected in One of my module. Even I haven't implemented in HTML only injected GridModule. But after build prod, the version of the module is too high to download in slow internet in mobile. I'm not able to open the page is slow internet mobile phone. It takes 10 seconds to download the 1mb of the chunk size.

Check chunk no 1 in both build snap.




3 Replies 1 reply marked as answer

SK Sujith Kumar Rajkumar Syncfusion Team September 21, 2020 11:03 AM UTC

Hi Deepak, 

Greetings from Syncfusion support. 

We could not reproduce your reported problem from our end as the chunk size was less on using production build. This is because the tree-shaking concept is used on running this command – “ng build --prod” to generate small file size with the modules in use and it was working fine for us. Please check below sample for reference, 


In this sample, we have imported the GridModule and injected the following services in the Grid – FilterService, PageService, SortService and tested your reported case. The list of feature modules that can be injected in the Grid can be checked in the following link, 


We suspect you might be facing the issue due to the imported modules so please share us the following information to validate further on this, 

  • Share us the ‘app.module.ts’ file in your application.
  • If possible share us a simple sample to replicate the problem or try reproducing it in the above provided sample. It would be helpful to identify your problem case better so that we can check and provide the solution based on that.

Let us know if you have any concerns. 

Regards, 
Sujith R 



DJ Deepak Jain September 22, 2020 07:13 AM UTC

Hi Sujith,

I downloaded the project from the given link and following is the observation :

1) main bundle size with grid - 1.68 MB
2) main bundle size without grid - 672 KB

Because of grid and its services, bundle size is increasing almost 1MB.
See below images.




SK Sujith Kumar Rajkumar Syncfusion Team September 25, 2020 11:10 AM UTC

Hi Deepak, 

Sorry for the delay in getting back to you. 
 
We validated your query and would like to let you know that when the GridModule alone is injected without any additional services the generated file size will be around 1.19 MB. This is the default size without any additional services injected. But when we go on to injecting Grid services like, Filter, Page, Sort the dependencies for these services will also be included in the generated file which increases the file size. Since these three services(Filter, Page, Sort) are injected along with the Grid module in the provided sample, the generated file size is around 1.68 mb. This will be the default size of the generated script file and it cannot be reduced. 
 
Like consider the Grid filtering service which has these filters - Filter Bar, Menu, Checkbox and Excel Filter. With this other EJ2 controls like, dropdown, checkbox, autocomplete are rendered for the Menu/Excel filter and so for this case, these control dependencies will also have to be included in the generated file. So the generated file size will depend on the injected module and services and it cannot be reduced as it only includes the injected modules. 
 
Let us know if you have any concerns. 
 
Regards, 
Sujith R 


Marked as answer
Loader.
Up arrow icon