Reduce bundle size

I'm having performace issues over bundle size.


1. Either the gridview or the pivotview reference pdf-export, while the PdfExportService was never imported.
2. Spreadsheet adds Ribbon and Edit, while niether of the respective service was imported.
3. can scheduler add an EditService to split ej2-calendars reference?
4. Can node_modules/@syncfusion/ej2-spreadsheet/styles/spreadsheet/all.scss split the ribbon related style? It makes styles larger.
5. rich-text-editor exports Image and Table, while the respective service never imported.
6. ej2-inputs is included, while never imported.
7. ej2-filemanager  is included, while never imported.

There are few smaller examples, but these are the main.

"dependencies": {
"@syncfusion/ej2": "^19.2.55",
"@syncfusion/ej2-angular-charts": "^19.2.55",
"@syncfusion/ej2-angular-circulargauge": "^19.2.55",
"@syncfusion/ej2-angular-diagrams": "^19.2.55", "@syncfusion/ej2-angular-grids": "^19.2.55", "@syncfusion/ej2-angular-kanban": "^19.2.55",
"@syncfusion/ej2-angular-layouts": "^19.2.55", "@syncfusion/ej2-angular-pivotview": "^19.2.55", "@syncfusion/ej2-angular-richtexteditor": "^19.2.55", "@syncfusion/ej2-angular-schedule": "^19.2.55", "@syncfusion/ej2-angular-spreadsheet": "^19.2.55", "@syncfusion/ej2-base": "^19.2.55" }

Imports:
import { ExcelExportService, GridModule, PagerModule, AggregateService, FreezeService, GroupService, PageService, ResizeService, SortService, SelectionService } from '@syncfusion/ej2-angular-grids'; import { ChartModule, LineSeriesService, ScatterSeriesService, ColumnSeriesService, SplineSeriesService, SplineAreaSeriesService, StripLineService, AreaSeriesService, ScrollBarService, StepLineSeriesService, StepAreaSeriesService, StackingColumnSeriesService, StackingLineSeriesService, StackingAreaSeriesService, BarSeriesService, StackingBarSeriesService, RangeColumnSeriesService, BubbleSeriesService, TooltipService, CrosshairService, CategoryService, DateTimeService, LogarithmicService, LegendService, ZoomService, DataLabelService, SelectionService, ChartAnnotationService, WaterfallSeriesService, RangeAreaSeriesService, PolarSeriesService, RadarSeriesService, DateTimeCategoryService, MultiLevelLabelService, ParetoSeriesService, TooltipRenderService, ExportService, AccumulationChartAllModule, AccumulationAnnotationService, AccumulationDataLabelService, AccumulationLegendService, AccumulationSelectionService, AccumulationTooltipService } from '@syncfusion/ej2-angular-charts';
import { PivotViewModule, ExcelExportService, GroupingBarService, NumberFormattingService, GroupingService, PivotChartService, ConditionalFormattingService } from '@syncfusion/ej2-angular-pivotview';
import { CircularGaugeModule, AnnotationsService, GaugeTooltipService, LegendService } from '@syncfusion/ej2-angular-circulargauge';
import { DiagramModule, ConnectorBridgingService, LineRoutingService, ComplexHierarchicalTreeService, BpmnDiagramsService, LayoutAnimationService, UndoRedoService, SnappingService, ConnectorEditingService, SymbolPaletteModule } from '@syncfusion/ej2-angular-diagrams';
import { ScheduleModule, DayService, WorkWeekService, MonthService, MonthAgendaService, ICalendarExportService, AgendaService, YearService } from '@syncfusion/ej2-angular-schedule';
import { SpreadsheetModule, SelectionService, BasicModuleService, ClipboardService, CellFormatService, KeyboardNavigationService, KeyboardShortcutService, NumberFormatService } from '@syncfusion/ej2-angular-spreadsheet';


19 Replies

ZB Zehavi Barak August 18, 2021 04:32 AM UTC

7. ej2-filemanager

8. ej2-dropdowns

9. ej2-popups
10. Can kanban split dialog into EditService?



JA Jesus Arockia Sankaran S Syncfusion Team August 23, 2021 05:04 PM UTC

Hi Zehavi, 

Thank you for contacting Syncfusion support. 

Currently we are checking your concerns and get back to you with further details on or before August 31, 2021. We request your support until then. 

Regards, 
Jesus Arockia Sankaran S 



FJ Frederik Jung August 30, 2021 03:15 PM UTC

I too think that the syncfusion size is just extreme. I found out while trying to reduce bundle size.


In the provided screenshot you can even see that the syncfusion stuff is bigger than the angular stuff, just crazy.

And I'm mostly only using grid, treegrid, and dropdown (some others are slightly used).


On the screenshot you can also see that there is a lot of stuff used that I did not clearly inject or use on any of the grids or treegrids like the pdf export or the navigations.

Any suggestion of how to reduce the exccessive syncfusion size?


Sadly there is a 100kb limit for an image, thats way too little and also the file browser does not accept jpg or png (wtf?).



Attachment: syncfusion_bundle_size_6b6a5e53.7z


JA Jesus Arockia Sankaran S Syncfusion Team August 31, 2021 09:56 AM UTC

Hi Zehavi  
 
Thank you for being patience.  
 
General Details: 
We have prepared simple Angular application with the Grid, RichTextEditor Angular Components and its bundle size for your reference. You can download the sample from the following link and check the reference image for bundle size.   
 
 
Reference Image: (These are the standard size for the above combination of components since bundle size varies based on the modules used in our project)  
 
For ng build  
For ng build --prod  
 
   
 
   
 
 
 
Query: Either the gridview or the pivotview reference pdf-export, while the PdfExportService was never imported.  
  
For PivotView: 
 
We can able to reproduce the problem at our end. We have considered this as an improvement. And it will be available in our 2021 Volume 3 SP release which is estimated to be rolled out at the end of October 2021. You can track the same by using below link.  
  
 
For Grid: 
Based on your query you are facing module inject issues in your Grid application. So, we have checked in our EJ2 Grid and found that everything works fine that is the pdfExportService is imported when you enable PdfExport in the Grid application and the PdfExportService module is not imported when you disable the pdfExport feature. For your convenience we have attached the screenshot and sample,  please refer them for your reference.  
  
Screenshot:  
   
  
In the above screenshot we have disabled the pdf export feature and the pdfexport related module is not imported in the Grid component.  
  
  
 
Query: Spreadsheet adds Ribbon and Edit, while niether of the respective service was imported.  
  
We have checked this query. We would like to let you know that we have already considered this(reduce the size of spreadsheet package by removing unwanted modules) as an improvement and it will be available in any of our upcoming release. We appreciate your patience until then. You can also track the status of this improvement using below feedback portal link.  
  
  
Query: Can node_modules/@syncfusion/ej2-spreadsheet/styles/spreadsheet/all.scss split the ribbon related style? It makes styles larger.  
  
We have checked this query. We will consider this case also while providing above mentioned improvement.  
 
Query:  rich-text-editor exports Image and Table, while the respective service never imported.  
   
While using the images and table features in the RichTextEditor, you should import the ImageService and TableService into the RichTextEditor.  
   
Refer to the below code snippets for your reference,  
import { Component } from '@angular/core';  
import { ToolbarService, LinkService, ImageServiceTableService,HtmlEditorService } from '@syncfusion/ej2-angular-richtexteditor';  
@Component({  
    selector: 'app-root',  
    templateUrl: 'app.component.html',  
    providers: [ToolbarService, TableService, LinkService, ImageService, HtmlEditorService]  
})  
export class AppComponent {  
}  
   

Query: 
Can kanban split dialog into EditService?

Currently, we do not have “EditService” module in Kanban and we do not have any immediate plan for this. However, we will update you the plan if any changes in the plan. You can track those using our roadmap or our feedback portal. 
 
Query: "can scheduler add an EditService to split ej2-calendars reference 
 
We checked your reported query "can scheduler add an EditService to split ej2-calendars reference" and suspect that you want the readonly scheduler by default (i.e. you don't want to perform any CRUD operations in the scheduler). You may use the scheduler to prevent the CRUD actions in two ways.  
  
  
public eventSettingsEventSettingsModel = {  
    dataSource: this.data,  
    allowAdding: false// Prevent Adding new event  
    allowEditing: false//Prevent event Editing  
    allowDeleting: false// Prevent event deletion  
  };  
  
Note:  Also, let you know that scheduler don’t have EditService module.   
 
Currently, we do not have “EditService” module in Kanban and we do not have any immediate plan for this. However, we will update you the plan if any changes in the plan. You can track those using our roadmap or our feedback portal. 
 
Query: Regarding the included the ej2 package even though it is not directly imported into your application. 
 
We want to inform you that Grid, TreeGrid, PivotView, Diagram, Spreadsheet, RichTextEditor are the sophisticated UI components which are developed using multiple small ej2 components such as input, button, dropdown, popup, ect.. So, the required packages are included automatically included in the bundle file as per the dependency of the  Syncfusion component imported in your application. We can not avoid the dependent packages.  
 
Regards, 
Jesus Arockia Sankaran S 
 



JA Jesus Arockia Sankaran S Syncfusion Team August 31, 2021 10:08 AM UTC

Hi Frederik, 

Thank you for contacting Syncfusion support. 

We have checked your queries and we request you to refer our previous update for bundle size related query of yours. Also, we kindly ask you to share more details about the image size constraint query such as Syncfusion component name, the scenario in which you experience the image size constraint. 

Please get back to us with requested details and further query if any. 

Regards, 
Jesus Arockia Sankaran S 



BA Barak September 30, 2021 01:40 PM UTC

hi,


Thank you for the elaborated reply.


Quick notes:

  • The RichTextEditor reference filemanager, while FileManagerService not added as Angular provider.
  • The Schedular in my case was set readonly. Still, some controls like input etc. were added.
  • The Grid (or other component) reference input, etc. while  
  • EditService not added.  


Regards and thanks a,


GV Gokulraj Varatharajan Syncfusion Team October 4, 2021 02:45 PM UTC

Hi Barak,  
  
We would like to let you know that some of our components have internal dependents within the components which is default behavior of the component.  So the dependent components are loaded automatically in our side. 
 
Please get back to us if you have any queries.  
 
Regards,  
V Gokul  



BA Barak October 5, 2021 05:01 AM UTC

The Syncfusion Angular documentation states components can be used by loading only the necessary modules and services. You have for example ChartModule and ChartAllModule, StepSeriesService, etc.

Is it not relevant? Does some of the packages ignore it?




GV Gokulraj Varatharajan Syncfusion Team October 6, 2021 12:16 PM UTC

Hi Barak, 
 
Yes, we have mentioned in our documentation section that we can use only necessary modules or all modules based on requirements. From this information, we would like to let you know that only imported services or modules are loaded in angular application. Apart from that, our dependent packages also injected in our source. 
 
For example, in our Chart components we have calendars, data manager and pdf-export as dependent. While using this component, required dependent packages also imported. 
 
Please get back to us if you have any queries. 
 
Regards, 
V Gokul 



BA Barak October 6, 2021 12:19 PM UTC

The Chart component behaves this way. The other large packages here - does not.



GV Gokulraj Varatharajan Syncfusion Team October 8, 2021 01:11 PM UTC

Hi Barak, 
 
Yes, Some of our big components like chart, Grid will behave the same way. For an example only we have provided an explanation with chart component.  And we would like to let you know that our all components will render in the same concepts only. 
 
If we misunderstood your requirement, could you please provide additional details about the requirement. Which will be helpful for us to assist better. 
 
Regards, 
V Gokul 



BA Barak October 8, 2021 01:26 PM UTC

as I wrote above, I'm not using file-manager, or pdf-export. Other components as scheduler does'nt import edit service. and yet - these consume considerable size in the build. My requirment from all components is readonly, so inputs, dialog, drop-down-list, time-picker - are never referenced.


thanks,



GV Gokulraj Varatharajan Syncfusion Team October 11, 2021 01:48 PM UTC

Hi Barak, 
 
Could you please confirm, currently which component bundle size are you looking for? Which will be helpful for us to provide an accurate suggestion. 
 
Please get back to us if you have any queries. 
 
Regards, 
Gokul 



BA Barak October 17, 2021 02:06 PM UTC

The bundle size is (minimized) is currently ~13mb, of which ~62% is syncfusion. Code in my view should be able to drop unsed functions and classes by tree-shacker.

Same with scss, 1.2mb of which 600kb+. I suggest dividing scss to more focused parts. 


T



GV Gokulraj Varatharajan Syncfusion Team October 19, 2021 02:20 PM UTC

Hi Barak, 
 
Sorry for delayed update. 
 
As we have requested in the previous update can you please share the list of components you are using, so that we can able to check the bundle size of the components and provide better solution on this. Currently we don’t have support for splitting the SCSS of the components based on the modules used. 
 
Regards, 
Gokul


BA Barak October 19, 2021 02:33 PM UTC

Hi,


I'm usnig the following:


    "@syncfusion/ej2-angular-charts": "^19.3.45",

    "@syncfusion/ej2-angular-circulargauge": "^19.3.44",

    "@syncfusion/ej2-angular-diagrams": "^19.3.45",

    "@syncfusion/ej2-angular-gantt": "^19.3.45",

    "@syncfusion/ej2-angular-grids": "^19.3.45",

    "@syncfusion/ej2-angular-kanban": "^19.3.45",

    "@syncfusion/ej2-angular-pivotview": "^19.3.44",

    "@syncfusion/ej2-angular-richtexteditor": "^19.3.45",

    "@syncfusion/ej2-angular-schedule": "^19.3.44",

    "@syncfusion/ej2-angular-spreadsheet": "^19.3.45",


Thanks



MS Mydeen S N Syncfusion Team October 20, 2021 12:23 PM UTC

Hi Barak,


Thanks for your reply.


We will check the listed component from our end and get back to you on October 25 2021.


Regards,

Mydeen S N



GV Gokulraj Varatharajan Syncfusion Team October 26, 2021 04:02 PM UTC

Hi Barak,  
   
Sorry for the inconvenience.  
  
We are validating your query and we will update the further details in two business days on or before October 28, 2021. 

We appreciate your patience until then. 

Regards,   
Gokul  



GV Gokulraj Varatharajan Syncfusion Team October 28, 2021 01:39 PM UTC

Hi Barak, 
 
Sorry for the inconvenience. 
 
We have validated your reported query and would like to let you know that you listed our components are high weight components and, in this control, have much modules than other components. So, its actual size is little bit high compared to other components and we have tried to reduce the bundle size from our end, and we have to work from our components side also. And currently we do not have plan for using scss style split-up based on the modules. 
 
Please let us know if you have any queries. 
 
Regards, 
Gokul

Loader.
Up arrow icon