GWT code splitting and generics

268 views
Skip to first unread message

Jérémie

unread,
Jul 24, 2019, 10:20:14 AM7/24/19
to GWT Users
Hi,

A little question about gwt coe splitting features. I am in the process of splitting a large application using GIN.
When I look at the soyc report, it's look like gwt doesn't support generics when checking for candidates for code splitting.

For example, I have a class with @Inject Provider<A> provider;
The soyc report shows me a dependency between this class and every GIN Provider<X>, making code splitting difficult/impossible.

Am I wrong, or is there some compiler option/tricks to make it work ?

Regards,
Jérémie

Jens

unread,
Jul 24, 2019, 11:19:06 AM7/24/19
to GWT Users
GIN has a AsyncProvider<T> class which calls GWT.runAsync(...) internally to code split T with T being something concrete that GIN can inject.

Have you tried that AsyncProvider instead? 

-- J.

Jérémie

unread,
Jul 24, 2019, 11:56:42 AM7/24/19
to GWT Users
Yes, I am using AsyncProvider<> to create split point. The issue is not here, the split point is created. However, most of my code stay in the initial fragment because every Provider<> are merged together (If I understand correctly the soyc)

For exemple :
- I have an AsyncProvider<A> and A has a dependency to a Provider<X>
- I have another AsyncProvider<B> and B has a dependency to a Provider<Y>
- the EntryPoint use a Provider<Z>

I was hoping to have a splitpoint with A+X, another with B+Y and the initial fragment with Z
However, after the compilation, X, Y and Z are in the initial fragment, and the soyc says that Provider<X> and Provider<Y> are used by my entrypoint.
Reply all
Reply to author
Forward
0 new messages