GWTP代码拆分

Har*_*hra 3 gwt gwt-gin gwt-platform

我正在使用GWT(GW的MVP框架)和GWT 2.3.我想与我的演示者一起使用GWT代码分割.

我知道@ProxyCodeSplit演示者中的注释.如下

@ProxyCodeSplit
@UseGatekeeper(LoggedInGatekeeper.class)
public interface MyProxy extends Proxy<MainPagePresenter> {
}
Run Code Online (Sandbox Code Playgroud)

这够了吗?或者我是否需要挖掘出A call to GWT.runAsync类似于此处的 GWT Code Splitting

Ümi*_*mit 5

不,GWT.runAsync只要显示相应的Presenter ,GWTP就会为您打电话.
但是请确保您使用AsyncProviderGinjector:

@GinModules({ MyModule.class })
public interface MyGinjector extends Ginjector {
  PlaceManager getPlaceManager();
  EventBus getEventBus();
  AsyncProvider<MainPagePresenter> getMainPagePresenter();
}
Run Code Online (Sandbox Code Playgroud)