Monday, October 7, 2024

Re: How to do code splitting in latest GWT SDK?

Without seeing your code, it will be hard to guess what is happening here. Did you enable each of those locales in your app (i.e. in a .gwt.xml file)? That, combined with your usage of the currency data in some widget/class should be the only way that those classes are included in your output.

Additionally, you might be ending up with every single locale in a single permutation because <collapse-all-properties /> or <collapse-properties .../> was specified in the .gwt.xml, indicating that more than one locale should be combined into a single output.

Absent specifics of your application and how it is set up, it is hard to guess beyond that.
On Saturday, October 5, 2024 at 6:05:58 AM UTC-5 David wrote:
Thank Colin very much. I am following the above url to do code splitting. I found initial download size is very big. Left over code only takes 1%. 75 org.gwtproject.i18n.shared.cldr.impl.CurrencyList_XX are generated. Each has 10741 bytes in size. I don't need all CurrencyList files. How do I reduce  CurrencyList files?

Thanks,

David


On Saturday, October 5, 2024 at 10:26:52 AM UTC+8 Colin Alworth wrote:
While gwt-core and the other refactored modules are intended to be both gwt-compatible and j2cl-compatible, there are a small handful of classes and methods in those refactored modules that, in their original form, were somehow specific to the GWT compiler itself.

The com.google.gwt.core.client.GWT class is one such class that mostly consists of "magic", where there is no java or js implementation of many of its members, but those members exist to allow the compiler to rewrite certain calls with specific behavior. As such, org.gwtproject.core.client.GWT cannot correctly implement all of those methods, and throws exceptions where it must fail.

In a case like this, you must call the original method on the com.google.gwt class while you still use GWT. If you migrate to j2cl and closure, you must find another solution there - j2cl has no split points, and closure-compiler doesn't even think of split points in the same way that GWT does. So, as long as you continue to use GWT 2, call the runAsync() method on the com.google.gwt.core.client.GWT class, and refer to https://www.gwtproject.org/doc/latest/DevGuideCodeSplitting.html for more guidance.


On Friday, October 4, 2024 at 9:24:54 PM UTC-5 David wrote:
I use GWT 2.10.

David

On Saturday, October 5, 2024 at 10:18:56 AM UTC+8 David wrote:
In gwt-core-1.0.0-RC1.jar, I see "Pick either GWT2 split point or Closure-Compiler chunks". Where can I find a code splitting SDK?


David

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/9a962788-4a64-4a6c-a4cd-bec85d738fe3n%40googlegroups.com.

No comments:

Post a Comment