Question

I am using GWTP (MVP framework by Google) with GWT 2.3. I want to use GWT code splitting with my presenters.

I know about @ProxyCodeSplit annotation in Presenters. Like below

@ProxyCodeSplit
@UseGatekeeper(LoggedInGatekeeper.class)
public interface MyProxy extends Proxy<MainPagePresenter> {
}

Is this sufficient ? Or Do I need to dig out GWT Code Splitting which provides A call to GWT.runAsync like Here

Was it helpful?

Solution

No, GWTP will take care of calling GWT.runAsync for you, whenever the corresponding Presenter is shown.
However make sure that you use AsyncProvider in your Ginjector:

@GinModules({ MyModule.class })
public interface MyGinjector extends Ginjector {
  PlaceManager getPlaceManager();
  EventBus getEventBus();
  AsyncProvider<MainPagePresenter> getMainPagePresenter();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top