GwtMaterialDesign / gwt-material-amcharts4

Amcharts Version 4 for GMD
https://gwtmaterialdesign.github.io/gmd-amcharts4-demo/
Apache License 2.0
3 stars 4 forks source link

Remove entry-points from XML #4

Open pH4Lk0n opened 5 years ago

pH4Lk0n commented 5 years ago

I'm trying to use this library along with SmartGWT but core.js included in this version is making a mess. Newer versions works fine. But unfortunately core.js is hard-coded in library and I cannot load without it because of resources used in onModuleLoad(). So everything brakes down when I just add inherits in xml. So I've a suggestion. Remove entry-points from XMLs. They are not actually execute and they only enforce inclusion off all TextResources. You still need to manually call injectJs methods so there is no benefit of this. So when I just add inherits to my project XML code is automatically larger of 1MB (AmCharts base code) even if it's not called. When you remove those entry-points TextResources (ex.core.js) are only included to compiled code when they are actually used. Other benefits:

I would also move them to another module to be more clear about it. Best regards

kevzlou7979 commented 5 years ago

Interesting thoughts we will be discussing this to our team and make a simple POC then add this to 2.3 release.

Thanks for sharing your ideas.

pH4Lk0n commented 5 years ago

Investigating this further. Problem with SmartGWT integration was loading order. For some reason AmCharts core.js must be loaded before SmartGWT core libraries. That's why it cannot be called in Java code. I will investigate this further.

For now to make it all work I've only deleted entry-point in GwtMaterialAmCore.gwt.xml since there is already GwtMaterialAmChartsBase.gwt.xml without one.

And also thanks to that I can use latest AmChart with your jsinterop library.