Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove entry-points from XML #4

Open
pH4Lk0n opened this issue Jun 13, 2019 · 2 comments
Open

Remove entry-points from XML #4

pH4Lk0n opened this issue Jun 13, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@pH4Lk0n
Copy link

pH4Lk0n commented Jun 13, 2019

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:

  • You can then manually load those libraries in different way on demand when they are actually needed - it's very useful in large applications.
  • You can load core.js and others from html script tags and upgrade those files not needed to wait until library gets upgraded.

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

@kevzlou7979
Copy link
Contributor

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.

@kevzlou7979 kevzlou7979 added the enhancement New feature or request label Jun 13, 2019
@kevzlou7979 kevzlou7979 self-assigned this Jun 13, 2019
@pH4Lk0n
Copy link
Author

pH4Lk0n commented Jun 14, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants